openapi_spec!() { /* proc-macro */ }
Expand description

Generate and return a closure that can be used to generate the OpenAPI specification.

This closure take 1 argument:

  • settings: rocket_okapi::settings::OpenApiSettings

It returns rocket_okapi::okapi::openapi3::OpenApi.

Example:

let settings = rocket_okapi::settings::OpenApiSettings::new();
let spec = rocket_okapi::openapi_spec![get_message, post_message](settings);