Skip to content

Releases: GREsau/okapi

rocket-okapi v0.8.0

14 Jan 22:49
rocket-okapi-v0.8.0
e53cc9b
Compare
Choose a tag to compare

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 (implemented OpenApiResponderInner):
    • Box<T>
  • Added support for new FromRequest
    types (implemented OpenApiFromRequest):
    • 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 with rocket_ws.
  • Added new example for WebSockets.
  • Added support for new Responder
    types (implemented OpenApiResponderInner):
    • rocket_ws::Channel<'o> (when rocket_ws feature is enabled)
    • rocket_ws::stream::MessageStream<'o, S> (when rocket_ws feature is enabled)
  • Added support for new FromRequest
    types (implemented OpenApiFromRequest):
    • rocket_dyn_templates::Metadata<'r> (when rocket_dyn_templates feature is enabled)
    • rocket_sync_db_pools::example::ExampleDb (when rocket_sync_db_pools feature is enabled)
    • rocket_ws::WebSocket (when rocket_ws feature is enabled)
  • Added get_nested_endpoints_and_docs to support more module based APIs. (#137, #138)

Changed

  • rocket-okapi and rocket-okapi-codegen require rocket 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 and persist_auth.
    • UiConfig added: css_file and css_classes.
    • NavConfig added: show_method_in_nav_bar, nav_accent_text_color, nav_active_item_marker
      and on_nav_tag_click.
    • NavConfig removed: nav_bg_image, nav_bg_image_size and nav_bg_image_repeat.
    • HideShowConfig added: allow_spec_file_download, allow_advanced_search and show_curl_before_try.
    • ApiConfig changed: api_key_name, api_key_location and fetch_credentials.
    • SlotsConfig added: operations_top.
    • Note: The default RenderStyle changed from View to Read.
    • Note: schema_hide_read_only and schema_hide_write_only changed behavior.
  • Updated Swagger UI to v5.11.0.
  • Updated all crates to Rust 2021 edition.
  • Renamed uuid example to uuid_usage, so it does not collide with uuid 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

29 May 20:19
rocket-okapi-v0.8.0-rc.3
Compare
Choose a tag to compare

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 and rocket-okapi-codegen require rocket v0.5.0-rc.3. (#122)

Fixed

  • mount_endpoints_and_merged_docs! does avoid combined paths with double /.
  • Raw identifiers (r#type) can now be used in parameters. (#117)
  • rocket::form::Form<T> now set requested data as "multipart/form-data". (#80)

rocket-okapi v0.8.0-rc.2

15 Jun 21:16
Compare
Choose a tag to compare

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 to 0.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 (implemented OpenApiResponderInner):
    • Arc<str>
    • Arc<[u8]>
    • Box<[u8]>
    • Box<str>
    • rocket::response::Redirect adds 500 Internal Server Error status code.
    • rocket_dyn_templates::Template (requires rocket_dyn_templates feature)
      (See example)
    • Some other changes because of renamed types in Rocket.
  • Added support for new FromRequest
    types (implemented OpenApiFromRequest):
    • rocket::http::uri::Host
    • Certificate (when mtls feature is enabled)
    • FlashMessage
    • rocket_db_pools::Connection<D> (when rocket_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> from String type is binary data (Vec<u8>) in FromData implementation. (#65)
  • Fixed missing of schema for EventStream and TextStream. (#86)
  • Generated functions are no longer included in Rust Documentation. (#69)

Fixed

  • Response schema added for Vec<u8>, &[u8], std::fs::File and other octet-streams. (#72)
  • Fix support for Streams: (#68)
    • rocket::response::stream::ByteStream<S>
    • rocket::response::stream::ReaderStream<S>
    • rocket::response::stream::TextStream<S>

rocket-okapi v0.8.0-rc.1

10 Oct 20:06
Compare
Choose a tag to compare

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 and openapi_spec macros to allow lower level access to the generation
    of the routes and specification respectively.
  • Added openapi_get_routes, openapi_get_routes_spec and openapi_get_spec to get a combination
    of Vec<rocket::Route> and/or okapi::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 (implemented OpenApiResponderInner):
    • 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 feature msgpack is enabled)
  • Fully implement FromSegments for <param..> in path. (#41)
  • Implement OpenApiFromSegments for all that implement FromSegments and JsonSchema. (#41)
  • Implement OpenApiFromParam for all that implement FromParam and JsonSchema.
  • Implement OpenApiFromFormField for all that implement FromFormField and JsonSchema.
  • Added support for new FromData
    types (implemented OpenApiFromData):
    • 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 feature msgpack 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 (implemented OpenApiFromRequest):
    • std::net::IpAddr
    • std::net::SocketAddr
    • Result<T, T::Error>
    • Option<T>
    • &'r rocket::config::Config
    • &'r rocket::config::SecretKey(only when feature secrets 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 in Schema
    all parts of the OpenAPI documentation.
  • Okapi create is now re-exported and can be found as rocket_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 from swagger_ui::UrlObject to settings::UrlObject.
  • Replaced manual implementations of OpenApiFromParam with generic version.
    So OpenApiFromParam is implemented for more types.
  • Replaced manual implementations of OpenApiFromFormField with generic version.
    So OpenApiFromFormField 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 with openapi_routes.

okapi v0.7.0-rc.1

10 Oct 20:05
Compare
Choose a tag to compare

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 of okapi::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 to impl_json_schema feature flag.

Fixed

  • Fixed casing in SecuritySchemeData.

rocket_okapi v0.7.0-alpha-1

12 Jun 21:39
Compare
Choose a tag to compare

Support for Rocket 0.5.0-rc1 (#42)!

rocket_okapi v0.5.1

25 May 18:34
Compare
Choose a tag to compare

Adds support for Query parameters in url (#26)

rocket_okapi v0.5.0

24 May 19:27
Compare
Choose a tag to compare
  • Add Cargo.toml info to openapi file (#23)
  • Add extra options to SwaggerUIConfig (#24)
  • Improve compile error/warning reporting (#12 / #27)

v0.4.0

26 Mar 20:07
Compare
Choose a tag to compare

schemars updated to 0.7

v0.3.0

26 Mar 20:06
Compare
Choose a tag to compare

schemars updated to 0.6