All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
- Actix plugin: Internals of
#[api_v2_operation]
proc macro (long-outstanding technical debt). This now generates operation metadata (on the fly) for each handler, which enables us to tie custom changes to operations easily.
0.4.1 - 2020-07-01
- Re-exported import from
proc-macro-error
which broke builds.
0.4.0 - 2020-06-13
- Client timeout in CLI.
- Codegen for header parameters in operations.
- Validation for non-body parameters.
x-rust-dependencies
field in root for specifying additional crate dependencies.- Default en/decoders (JSON/YAML) and support for custom en/decoders through
x-rust-coders
field in root. - Methods to
Schema
trait for aiding resolution and codegen. - Codegen for nested arrays in operation parameters.
- Codegen for form data parameters in operations.
- Codegen for
Any
type in schema. - CLI payload encoding/decoding supports custom types and not limited to JSON.
- Codegen for
#[deprecated]
attribute whendeprecated
field is set totrue
in schema. - Codegen adds
Request
andResponse
traits for HTTP request and response objects. - CLI uses name and version from
info
field in spec. - Codegen for file responses with streaming to
AsyncWrite
implementors. - Codegen for
multipart/form-data
parameters with file streaming. - Referencing globally defined parameters and responses.
- Codegen for enums in object definitions.
- Response wrapper containing headers and status code for operation.
- Parsing for custom response headers.
- Actix plugin:
#[openapi(empty)]
attribute can be used to any type to implement empty schema and ignore the warning. - Actix plugin: Empty impls for some actix-web types (like
Payload
,Data<T>
, etc.). - Actix plugin: Raw JSON spec generation from handlers.
- Actix plugin: Support for
#[serde(rename = "...")]
and#[serde(rename_all = "...")]
. - Actix plugin: Support for error (non-2xx) response codes.
- Actix plugin: Type-level and field-level documentation is now used for
description
fields in schema and properties. - Actix plugin: Security definitions (globally) and security requirements (for operations).
- Actix plugin: Support for
serde_json::Value
andserde_yaml::Value
(by default), and for objects fromuuid
,rust_decimal
,chrono
, etc. (through features of the same name) in structs.
- Switched to templating for (almost) static modules.
- Operation IDs are preferred for method names if they exist.
ApiClient
uses the newly addedRequest
andResponse
and is now async/await.Sendable
accepts the newApiClient
and is now async/await.SchemaRepr
renamed toResolvable
.OperationMap
renamed toPathItem
.Api
struct is now generic over parameters and responses in addition to definitions.- Actix plugin: Switched to
actix-web = "^2.0"
. - Actix plugin: Supports stable compiler.
- Actix plugin:
#[api_v2_schema]
macro attribute is now#[derive(Apiv2Schema)]
.
- Switched
enum
field to array ofany
rather than strings. - Resolution of anonymous schema definitions in objects, operation parameters and responses.
- Unmappable operations (i.e., without body parameters and simple response types) are now namespaced in a separate module.
- Array definitions are now allowed in schemas.
additionalProperties
takes boolean or a schema.- Deadlock when resolving some recursive types.
- Actix plugin:
.route()
method call onApp
,Scope
andServiceConfig
don't override existing route operations. - Actix plugin:
web::Path<T>
also supports simple types (strings, integers, etc.). - Actix plugin:
#[api_v2_schema]
derivatives can now use references. - Actix plugin: Breakage of
#[api_v2_operation]
when returningimpl Handler
. - Actix plugin:
web::scope
supports having path parameters. - Actix plugin: Misuse of
actix_web::Scope
inApp::configure
which resulted in missing overwritten routes.
0.3.0 - 2019-07-30
- Paperclip's
#[api_v2_schema]
derives raw schema structs (i.e., no smart pointers) along with actual schema structs for other users and plugins. An effect of this would be that now there's aDefaultSchemaRaw
in addition toDefaultSchema
. TypedData
,Apiv2Schema
andApiv2Operation
traits for deriving v2 spec for server plugins.paperclip-core
crate for segregating core types and traits.paperclip-actix
crate as an actix-web plugin for hosting v2 spec as a JSON by marking models and operations using proc macro attributes.paperclip::actix
module for exportingpaperclip_actix::*
whenactix
feature is enabled.
- Segregated dependencies using feature gates.
Api::<S>::resolve
now returnsValidationError
instead offailure::Error
.- During serialization, optional schema fields are skipped when empty/null.
- Allowing ports in
host
field in v2 spec.
0.2.0 - 2019-07-03
- Gitbook for detailed documentation and walkthroughs.
- Changelog
- Root module (
mod.rs
,lib.rs
ormain.rs
) generation for codegen (previously we were only generating children modules). - Cargo manifest generation (gated by
"cli"
feature). [bin]
target (CLI) for generating crates.- CLI generation (fancy curl for your APIs) - generated app uses async/await and
runtime_tokio
. ApiClient::make_request
for sending a request and fetching a response future.- Support for operations returning array of objects.
- Codegen uses
basePath
andhost
fields (if they exist) to override default base URL (https://example.com
). - API relative paths are checked for uniqueness.
- Codegen now writes the dependency traits, types and impls in the root module.
ApiClient::base_url
in favor ofApiClient::make_request
- Redundant
Optional
trait for generated markers.
- Templated paths are now validated against parameters.
- Import prefixes support in emitter (for codegen).
0.1.0 - 2019-06-13
- Build script example in README.
impl Sendable
for fulfilled builders to send API requests and return response futures.- Documentation for builders and methods from
description
fields. - Generation of
#[repr(transparent)]
builders with phantom fields for enforcing required parameters. - Generation of builders for API objects and operations.
- Generation of Rust structs with appropriate serde rules from definitions.
#[api_schema]
proc-macro attribute for implementingSchema
trait for custom schemas.- Resolution of
$ref
references in definitions and paths to objects in the same file. - Loading OpenAPI v2 schema from JSON/YAML
- Workspace, README, LICENSE, Makefile, CI config, etc.