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.
- Bump
derive_moreto2.0 - Fix webhook nesting #1031
- add support for num::NonZero #1041
- Support deep linking in Swagger UI #1049
- Add support to externally tagged unions #1043
- add scalar ui support #1019
- support
DurationandTimestampfromprost_wkt_types#1016 - Object fields deprecation #1026
- add support for server variables #962
- the
Binarytype no longer requirescontent-typeto beapplication/octet-stream.
- feat:
ignore_caseparameter inOpenApimacro can be used to operation.
- feat: add
ignore_caseparameter forOpenApimacro.
- fix(openapi): do not use
cookiefeature by default #986 - fix: guard cookie features behind feature toggle #997
- Support rename in NewType #964
- fix(openapi): exclude style parameter when serializing if none #989
- fix(poem-openapi): handle additional_properties correctly in flatten #961
- fix(poem-openapi-derive): Allow different path param names on same route #952
- Update MSRV to
1.85.0
- Allows passing the style of a parameter in the openapi spec. #940
- Add support for Stoplight Elements #954
- Correct server object reference URL anchor #957
- feat(openapi): reflect fallback security scheme in spec #958
- Fix missing condition for Stoplight Elements UI #972
- Update MSRV to
1.83.0
- Add description to Union descriminator object schema #921
- make Json from poem-openapi derive Default because Json from poem does #938
- Pass
ParsePayload<T>::IS_REQUIREDtoTinstead of defaulting totrue#932 - allow path in status for ApiResponse #937
- Assign the description to the request object in OpenAPI #886
- Implemented nullable fields for openapi spec generation #865
- refactor: change type name delimiters from
<>()[]to_#904
- Update MSRV to
1.81.0
- implements
SerializeandDeserializeforpoem_openapi::types::Any<T>. - add
ParseError::message methodto get the error message.
- fix #883
- fix read_only_with_default test when only default features are enabled #854
- feat: add AsyncSeek trait to Upload::into_async_read return type #853
- Added derivations for Type, ParseFromJSON and ToJSON for sqlx::types::Json. #833
- chore(openapi): bump derive_more #867
- Added derivations for Type, ParseFromJSON and ToJSON for sqlx types #833
- Add enum_items to discriminated union #741
- fix Union doesn't implement IsObjectType #800
- fix Union doesn't support generics in the last version #799
- Expose Poem-OpenApi Upload File struct #816
- use AFIT instead of
async_trait - add
Upload::sizemethod - when
Unionuses discriminator, if the members is not anObject, an error will be reported at compile time
- added example value support for param/schema #717
- Adding serialize_with and deserialize_with attributes to struct fields #749
- upgrade to
hyper1 - added documentation on how to merge API specs #716
- impl Type for std::time::Duration instead of only humantime::Duration #713
- add
prost-wkt-typescrate support #689 - add
geo-typescrate support #693 - count string length correctly in OpenAPI validators #666
- Support for custom hash functions for HashMap/HashSet #654
- Misplaced ``` in swagger_ui HTML template #660
- for
read-onlyproperties, can usedefaultto specify a function for creating a default value. #647
fn default_offset_datetime() -> OffsetDateTime {
OffsetDateTime::now_utc()
}
#[derive(Debug, Object, PartialEq)]
struct Obj {
#[oai(read_only, default = "default_offset_datetime")]
time: OffsetDateTime,
}- fixes #648
- allow using expressions as
prefix_pathparameter #635 - bump
quick-xmlfrom0.29.0to0.30.0
- Add fallback support for
SecuritySchememacro used on enums
- Add support for multiple authentication methods. #627
- change
fn ApiExtractor::security_schemes() -> Option<&str>tofn ApiExtractor::security_schemes() -> Vec<&str>
- openapi: allows multiple security schemes on one operation #621
- bump
synfrom1.0to2.0 - bump
darlingfrom0.14to0.20 - feat: introduce idle timeout #603
-
Since
syn 2.0no longer supports keywords as meta path, renamed some parameters in macros.Macro Old Name New Name SecuritySchema type ty SecuritySchema in key_in ApiResponse.header type ty -
Change
ApiExtractor::TYPEtoApiExtractor::TYPESto allow implementing multiple extractor in single type.
- feat: Implement Type on the char primitive #518
- Pattern matching in OpenAPI function args #517
- chore: add Clone for
OpenApiService#527 - Fix
#[derive(Multipart)]for struct, so it will work with#[derive(ApiRequest)]#551 - feat: Allow more types to be prased into strings #545
- Support for ipnet crate + IpAddr #544
- Add the missing feature
openapi-explorerinuimod #480 - Add yaml support #476
- Remove
poem_openapi::response::StaticFileResponseand implementApiResponse traitforpoem::web::StaticFileResponse
- Add support for OpenAPI Explorer #440
- Add
Ipv4AddrandIpv6Addropenapi support #442 - Parse Value(Number) into Decimal #452
- Parse other number types as well and fix float #454
- Responses generated by the
ApiResponsemacro have correct error messages when converted topoem::Error
- Add generic support to the
NewTypemacro - Fixes #436
- Bump quick-xml to
0.26.0 - Fixes #429
- Throws an error when
flattencombination with structs that usedeny_unknown_fields
- Fixes #405
- Add
EventStream::to_eventmethod to set a function used to convert the message to SSE event. #378 - OpenApi XML support #354
- Add
hiddenattribute for the operation #376
- Add the
defaultattribute to Object macro. #369
- Expose
AttachmentTypeenum #344 - Add
rename_allattribute forUnionmacro #347 - Change the default attachment type to
attachment#325 - Update
serde_yamlto 0.9.0 #352
- Use first line of comment as title of newtype param #319
- Add
Content-Dispositionheader to schema forAttachment#325 - Add support for
x-code-samples#335 - Return
400when parsing path fails, not404#326 - Use Parent_Child instead of Parent[Child] for generated intermediate type #340
- Fixed docs for
NewTypemacro
- Add support for specifying contact field #306
- Add
actual_typeattribute toOpenApi,Response,ResponseContentmacros #314
- Add integrate with the
timecrate. - Add support generating openapi UI html through the dedicated function. #298
- Add support for getting the spec as YAML #287
- Add optional support for humantime Duration in poem Object #293
- Publish
Poem-openapi v2.0.0🙂
- Re-added the
exampleattribute forObjectmacro. - Response
404 NOT FOUNDwhen parsing path parameters fails. #279
- Remove
inlineandconcreteattributes ofObjectandUnionmacros, now automatically generate reference names for generic objects.
- If the
inlineorconcretesattribute of the generic object is not specified, the exact error will be reported at compile time.
- Add support for generic union. #259
- Fixed
poem::web::StaticFileResponseconversion topoem_openapi::respoinse::StaticFileResponsemissingContent-Typeheader.
- Downgrades the
indexmapdependency to1.6.2to resolve tkaitchuck/aHash#95
- Implement
Typeforchrono::NaiveDateTime,chrono::NaiveDate,chrono::NaiveTime#252
- Fixed
#[oai(default)]not working with operation parameters. - Add
MaybeUndefined::update_tomethod.
- Generate responses in schema when
ApiResponseas an error. #244
- Implement
From<T: ApiResponse>forpoem::Errorso that it can be used as error type.
- Add support for use multiple methods on a single endpoint. #229
- Normalize decimals in responses. #228
- Add support for extra request/response headers.
- Add support for extra headers.
- Add support generic for
OpenAPImacro. #216
- Add
skip_serializing_if_is_none,skip_serializing_if_is_emptyandskip_serializing_ifattributes toObjectmacro. #220
- Implement
Typeforrust_decimal::Decimal. #214
- Add support for deriving remote objects to the
Objectmacro. - Add
poem_openapi::payload::Base64.
- Implement
From<T>,IntoIteratorforMaybeUndefined<T>. - Add
MaybeUndefined::from_opt_undefined,MaybeUndefined::from_opt_null,MaybeUndefined::as_ref,MaybeUndefined::as_derefmethods.
- Implement
ToJsonforMaybeUndefined.
- Add
MaybeUndefinedtype.
- Fix OpenAPI doesn't work with tracing::instrument. #194
- Fix unsupported media-type (415) instead of method not allowed (405). #188
- Integrate with
bson::oid::ObjectId. #185
- Make the
ApiRequestmacro exactly match the mime type.
- Add
Htmlpayload type. - Add
StaticFileResponsetype.
- Fixed stack overflow on recursive structures. #184
- Fixed
EventStreamnot registering internal types. - OpenApi schemas generated by the
Unionmacro are no longer inlined by default.
- Set Rapidoc's
schema-description-expandedoption totrue.
- Add
flattenattributeforObjectmacro.
- Fix stack overflow when generating schema for structure references Self. #171
- Add
HashSetandBTreeSetsupport to OpenAPI. #167 - Add
Urlsupport to OpenAPI. #168 - Breaking change: Remove
OneOfmacro and addUnionmacro, and replaceproperty_namewithdiscriminator_name.- The implementation of
OneOfwas incorrect. To migrate, change all instances ofOneOftoUnion, and all instances ofproperty_nametodiscriminator_name.
- The implementation of
- Add
deprecatedattribute toApiResponse's header field.
- Fixed the
externalDocsfield name is incorrect in the specification.
- Add
ToJSON::to_json_stringmethod.
- Add support for custom validator.
- Add
external_docsattribute for some macros. - Add
ParseFromJSON::parse_from_json_stringmethod.
- Add
NewTypemacro. #159
- Add
ResponseContentmacro.
- Add
deprecatedattribute toEnummacro.
- Add
OpenApiService::summarymethod.
- The
OneOfmacro no longer automatically implementsserde::Serializeandserde::Deserializetraits.
- The
Objectmacro no longer automatically implementsserde::Serializeandserde::Deserializetraits.
- Fix generates a field with #[oai(default)] marked as required even though it isn't. #145
- Add
EventStream::keep_alivemethod.
- Remove the
OpenApi::combinemethod,OpenApiService::newcan be passed a tuple to combine multiple API objects.
- The
content_typeattribute of theApiRequestmacro supports wildcards. - Add
EventStreampayload. - Implement
Typeforserde_json::Value.
#[derive(ApiRequest)]
enum UploadImageRequest {
#[oai(content_type = "image/jpeg")]
Jpeg(Binary<Vec<u8>>),
#[oai(content_type = "image/png")]
Png(Binary<Vec<u8>>),
#[oai(content_type = "image/*")]
Other(Binary<Vec<u8>>),
}- Added the
content_typeattribute to theApiRequestandApiResponsemacros to specify the content type of the request or response. - Panic occurs when a duplicate operation id is detected.
- Add
OpenApiService::external_documentmethod to referencing an external resource for extended documentation. - Add
Webhookmacro to define webhooks. - Implement
OpenApifor()to define an empty APIs.
- Make the
OpenAPImacro can now report duplicate routing errors.
- Fix the parameter validator will cause compilation failure in some cases.
- Add
remoteattribute toEnummacro. - Remove the
BinaryStreamtype, usepoem::Bodyinstead. - Do not rename any types by default. #128
- Add
BinaryStream::from_bytes_streamandBinaryStream::to_bytes_streammethods.
- Add some methods to specify more API metadata.
- Add
Responsetype, use it to modify the status code and HTTP headers.
- impl
ParseFromParameterfor [T; const LEN: usize]. - Add
exampleattribute forObjectmacro. - Add
deny_unknown_fieldsattribute forObjectandMultipartmacros.
- Add
Email/Hostnametypes. - Integrate with the
regex,uuid. - Implement
TypeforUri. - Implement
TypeforDateTime<Utc>andDateTime<Local>. - Add support for Redoc.
- Remove the
PoemExtractortype because it is no longer needed.
- Add
Attachmentpayload for download file. - Added
BinaryStreamto support streaming payload.
- Change the default renaming rule of enum items from
ScreamingSnaketoPascal.
- Remove the
descattribute of the response header inApiResponsemacro, and use rustdoc to add the header description. - Implement
ParseFromParameterforVec<T>.
- Remove the
listattribute of the validator, it is no longer needed. - Add
maxPropertiesandminPropertiesvalidators. - Add support to API operation with optional payload.
- Add support to API responses with optional header.
- Change the schema type of enum to
string#121
- Implement
Typefor&[T],&Tand[T; const N: usize]. - Add support for returning references from API operation functions.
- Fixed the bug that
Arc,Box,BTreeMapandHashMapdid not register subtypes.
- Add support for
additionalProperties.
- Rework implement
TypeforHashMapandBTreeMap.
- Implement
TypeforBox<T>,Arc<T>,HashMap<K, V>andBTreeMap<K, V>. #116
- Add support for RapiDoc.
- Remove the
descattribute of the operation parameter inOpenAPImacro, and use rustdoc to add the parameter description.
- If an OpenAPI name conflict is detected when creating schema, it will cause panic.
-
Remove
akasmafrom dependencies. -
#[oai(validator(list))]no longer applies tomax_items,min_itemsandunique_items.
- Add
listattribute to the validator. - Rework
OpenAPImacro.
- Omit empty security schemas from OpenAPI document. #93
- Description is a required field for responses. #86
- Add
versionandtitleparameters toOpenAPIService::new. #87
- Add
checkerattribute forSecuritySchememacro. - Use Rust 2021 edition.
- Some configurations no longer need
'static.
- Correctly determine the type of payload.
- Bump
poemto1.0.11.
- Make the return type of operation function more flexible.
- Add
Anytype.
- Add
read_only_allandwrite_only_alltoObjectArgs. #71
- Fix Json parsing not working for unsigned integers. #68
- Bump
poemfrom1.0.3to1.0.4.
- Add
prefix_pathandtagattributes for#[OpenApi]. #57 OpenApiService::swagger_uimethod no longer needs theabsolute_uriparameter.- Add
inlineattribute forObjectmacro. - Add generic support for
ApiRequestandApiResponsemacros.
- Add
write_onlyandread_onlyattributes for object fields. - Add
OpenApiService::specmethod to get the generated OAS specification file. - Implements
Defaulttrait forpoem_openapi::types::multipart::JsonField<T>. - Implements
ParseFromMultipartFieldfor some types.
- Add
Request::remote_addrmethod.