Utoipa 5.0.0 release - Compile time OpenAPI for Rust
It has been quite awhile since my last post and utoipa has been in relatively slow paced development during the year. However I have now reactivated for another major release of utoipa which brings about a bunch of perks. This is probably the biggest release since its launch and is packed with upgrades users have been yearning for. Make it a bit more utopic than before :rocket:
Those already using utoipa might want to look into Migration Guide to get a quick review of most fundamental changes and what to expect in the new release.
Some highlights added in the utoipa 5.0.0
- Full generic types support. This removes the old
aliasesattribute. From now on generics are supported and types must be declared with all type definitions upon usage. - Automatic schema collection from usages. When a schema is declared on request body or response body it will be collected along with possible schema refernces upon declaration to OpenApi with
paths(...)or in case of axum withroutes!(...)macro. From now on there is no need to declare schemas withcomponents(schemas(...))attribute anymore. - Support for Rust type aliases with
utoipa-configcrate. This adds build configuration for utoipa for adding aliases among the other configuration options. - Axum bindings
utoipa-axum. This crate brings axum and utoipa closer together by extending the axum Router functionality reducing duplication that is currently present. - Nesting support for OpenApi with
nest(...)attribute. This allows users to separate OpenApi definitions to separate modules which then can be nested under a given path. - Support in
#[utoipa::path(...)]to allow defining multiple http methods. - Better support for tuples and arrays regarding OpenAPI definition, thanks to OpenAPI 3.1
- All in OpenAPI 3.1, since 5.0.0 utoipa will only be OpenAPI 3.1 compliant which adheres fully to JSON Schema specification. This allows better type definition support in OpenAPI.
To find out more visit https://github.com/juhaku/utoipa
And for those interested of all changes done for the release you might want to take a look at https://github.com/juhaku/utoipa/blob/master/CHANGELOG.md