Releases: GREsau/okapi
Releases · GREsau/okapi
rocket-okapi v0.9.0
rocket-okapi v0.8.0
Okapi v0.7.0
Added
- Added
Eq
trait for various structures.
Changed
merge_paths
does correctly handle the merging of paths with double/
in the combined path.- Updated to Rust 2021 edition.
Rocket Okapi v0.8.0
Added
- Added support for new
Responder
types (implementedOpenApiResponderInner
):Box<T>
- Added support for new
FromRequest
types (implementedOpenApiFromRequest
):rocket::request::Outcome<T, T::Error>
- New feature flag
rocket_sync_db_pools
for compatibility with
rocket_sync_db_pools
. - New feature flag
rocket_ws
for compatibility withrocket_ws
. - Added new example for WebSockets.
- Added support for new
Responder
types (implementedOpenApiResponderInner
):rocket_ws::Channel<'o>
(whenrocket_ws
feature is enabled)rocket_ws::stream::MessageStream<'o, S>
(whenrocket_ws
feature is enabled)
- Added support for new
FromRequest
types (implementedOpenApiFromRequest
):rocket_dyn_templates::Metadata<'r>
(whenrocket_dyn_templates
feature is enabled)rocket_sync_db_pools::example::ExampleDb
(whenrocket_sync_db_pools
feature is enabled)rocket_ws::WebSocket
(whenrocket_ws
feature is enabled)
- Added
get_nested_endpoints_and_docs
to support more module based APIs. (#137, #138)
Changed
rocket-okapi
androcket-okapi-codegen
requirerocket v0.5.0
. (#132)- Updated RapiDoc to
v9.3.4
and updated settings, including changed defaults in RapiDocs.- Schema settings moved to
SchemaConfig
. GeneralConfig
added:update_route
,route_prefix
andpersist_auth
.UiConfig
added:css_file
andcss_classes
.NavConfig
added:show_method_in_nav_bar
,nav_accent_text_color
,nav_active_item_marker
andon_nav_tag_click
.NavConfig
removed:nav_bg_image
,nav_bg_image_size
andnav_bg_image_repeat
.HideShowConfig
added:allow_spec_file_download
,allow_advanced_search
andshow_curl_before_try
.ApiConfig
changed:api_key_name
,api_key_location
andfetch_credentials
.SlotsConfig
added:operations_top
.- Note: The default
RenderStyle
changed fromView
toRead
. - Note:
schema_hide_read_only
andschema_hide_write_only
changed behavior.
- Schema settings moved to
- Updated Swagger UI to
v5.11.0
. - Updated all crates to Rust 2021 edition.
- Renamed
uuid
example touuid_usage
, so it does not collide withuuid
crate.
This version also includes all the changes from 0.8.0-rc.1
, 0.8.0-rc.2
and 0.8.0-rc.3
.
See below for more info on the changes made in these versions.
rocket-okapi v0.8.0-rc.3
Note that this update is a minor version update, but still contains breaking changes because the
Rocket version had a minor update with breaking changes too. This will thus fix previous error
because of incompatibility.
Added
- Add
ignore
derive attribute to ignore function arguments from documentation. (#113) operation_id
can now be overwritten using#[openapi(operation_id = "my_custom_id")]
,
but it has to be unique in the API spec. (#63)- Added support for
#[openapi(deprecated)]
to mark endpoint as deprecated in spec. (#123)
Changed
rocket-okapi
androcket-okapi-codegen
requirerocket v0.5.0-rc.3
. (#122)
Fixed
rocket-okapi v0.8.0-rc.2
Note that this update is a minor version update, but still contains breaking changes because the
Rocket version had a minor update with breaking changes too. This will thus fix previous error
because of incompatibility.
Added
- Add support for
rocket::response::stream::EventStream<S>
(#52) - Update Rocket from
0.5.0-rc.1
to0.5.0-rc.2
. (#89) - Updated Swagger UI to
v4.12.0
. - Updated RapiDoc to
v9.3.2
. - New Rocket feature flags
mtls
re-exposed. - Added support for new
Responder
types (implementedOpenApiResponderInner
):Arc<str>
Arc<[u8]>
Box<[u8]>
Box<str>
rocket::response::Redirect
adds500 Internal Server Error
status code.rocket_dyn_templates::Template
(requiresrocket_dyn_templates
feature)
(See example)- Some other changes because of renamed types in Rocket.
- Added support for new
FromRequest
types (implementedOpenApiFromRequest
):rocket::http::uri::Host
Certificate
(whenmtls
feature is enabled)FlashMessage
rocket_db_pools::Connection<D>
(whenrocket_db_pools
feature is enabled) (#104)
- New feature flag
rocket_dyn_templates
for enable compatibility with
rocket_dyn_templates
. - New feature flag
rocket_db_pools
for enable compatibility with
rocket_db_pools
. - New example for Rocket's Dynamic Templates.
Changed
- Changed
Data<'r>
fromString
type is binary data (Vec<u8>
) inFromData
implementation. (#65) - Fixed missing of schema for
EventStream
andTextStream
. (#86) - Generated functions are no longer included in Rust Documentation. (#69)
Fixed
rocket-okapi v0.8.0-rc.1
Added
- Added feature flag
rapidoc
to enable RapiDoc documentation
viewer. (Based on #33) - Added RapiDoc v9.0.0
- Forbid unsafe code in this crate. (#36)
- Retrieve OpenApi object after generating. (#28)
- Create
mount_endpoints_and_merged_docs
marco in order to streamline code structure for
bigger projects. (#30) - Added new example for structuring bigger projects.
- Allowed changing path where OpenApi file is hosted.
- Added
openapi_routes
andopenapi_spec
macros to allow lower level access to the generation
of the routes and specification respectively. - Added
openapi_get_routes
,openapi_get_routes_spec
andopenapi_get_spec
to get a combination
ofVec<rocket::Route>
and/orokapi::openapi3::OpenApi
. - Optionally allows the setting of
OpenApiSettings
when generating the OpenApi objects and Routes. - Add support for UUIDs, and added example. (#38, #46, #54)
- Added
log v0.4
as a dependency. - Added
either v1
as a dependency. (Rocket dependency) - Added feature flag for
msgpack
(Re-exposing Rocket feature flag) - Added support for new
Responder
types (implementedOpenApiResponderInner
):std::fs::File
rocket::tokio::fs::File
std::borrow::Cow<'o, T>
either::Either<L, R>
std::io::Error
(rocket::http::ContentType, R)
(rocket::http::Status, R)
rocket::http::Status
(#20)rocket::response::status::NoContent
rocket::response::Redirect
rocket::response::content::Custom<T>
rocket::response::status::Conflict<T>
rocket::response::status::Custom<T>
rocket::response::Flash<R>
rocket::data::Capped<R>
rocket::response::Debug<E>
rocket::response::stream::ByteStream<S>
rocket::response::stream::ReaderStream<S>
rocket::response::stream::TextStream<S>
rocket::serde::msgpack::MsgPack<T>
(only when featuremsgpack
is enabled)
- Fully implement
FromSegments
for<param..>
in path. (#41) - Implement
OpenApiFromSegments
for all that implementFromSegments
andJsonSchema
. (#41) - Implement
OpenApiFromParam
for all that implementFromParam
andJsonSchema
. - Implement
OpenApiFromFormField
for all that implementFromFormField
andJsonSchema
. - Added support for new
FromData
types (implementedOpenApiFromData
):String
&'r str
Cow<'r, str>
Vec<u8>
&'r [u8]
rocket::fs::TempFile<'r>
rocket::data::Capped<rocket::fs::TempFile<'r>>
rocket::data::Capped<Cow<'r, str>>
rocket::data::Capped<&'r str>
rocket::data::Capped<&'r rocket::http::RawStr>
rocket::data::Capped<&'r [u8]>
rocket::data::Capped<String>
rocket::data::Capped<Vec<u8>>
&'r rocket::http::RawStr
rocket::form::Form<T>
rocket::serde::msgpack::MsgPack<T>
(only when featuremsgpack
is enabled)
- Added feature flag for
secrets
(Re-exposing Rocket feature flag) - Added support for Request Guards
and Security Scheme
(aka Authentication and Authorization) (#47, #9, #8, #56) - Added support for new
FromRequest
types (implementedOpenApiFromRequest
):std::net::IpAddr
std::net::SocketAddr
Result<T, T::Error>
Option<T>
&'r rocket::config::Config
&'r rocket::config::SecretKey
(only when featuresecrets
is enabled)&'r rocket::data::Limits
&'r rocket::http::Accept
&'r rocket::http::ContentType
&'r rocket::http::CookieJar<'r>
&'r rocket::http::uri::Origin<'r>
&'r rocket::route::Route
rocket::http::Method
rocket::Shutdown
&'r rocket::State<T>
- Added
OpenApiFromRequest
derive macro. - Added feature flag for
preserve_order
to keep the order of struct fields inSchema
all parts of theOpenAPI
documentation. Okapi
create is now re-exported and can be found asrocket_okapi::okapi
.
Changed
- Swagger UI is now only available under the feature
swagger
. - Updated Swagger UI to v3.52.0
- The
preserve_order
feature flag is now enabled by default. UrlObject
has been moved fromswagger_ui::UrlObject
tosettings::UrlObject
.- Replaced manual implementations of
OpenApiFromParam
with generic version.
SoOpenApiFromParam
is implemented for more types. - Replaced manual implementations of
OpenApiFromFormField
with generic version.
SoOpenApiFromFormField
is implemented for more types. - Fixed setting of parameter location from "form" to "query".
Removed
- Removed unused and unneeded files from Swagger UI to decrease file size.
routes_with_openapi
has be removed and replaced withopenapi_routes
.
okapi v0.7.0-rc.1
Added
- Forbid unsafe code in this crate. (#36)
- Allow customization of OpenApi object.
- Allow merging of OpenApi objects.
- Added
log v0.4
as a dependency. - Added
map!
macro for easy creation ofokapi::Map
objects. - Re-exported
Schemars
so the same version can be used without needing to import it.
Changed
- Change
OAuthFlows
to better represent the different flows and allowed values within them. - Renamed
derive_json_schema
feature flag toimpl_json_schema
feature flag.
Fixed
- Fixed casing in
SecuritySchemeData
.
rocket_okapi v0.7.0-alpha-1
Support for Rocket 0.5.0-rc1 (#42)!
rocket_okapi v0.5.1
Adds support for Query parameters in url (#26)