openapi_routes!() { /* proc-macro */ }
Expand description
Generate and return a closure that can be used to generate the routes.
This closure take 2 arguments:
spec_opt
:Option<rocket_okapi::revolt_okapi::openapi3::OpenApi>
settings
:rocket_okapi::settings::OpenApiSettings
It returns Vec<::rocket::Route>
.
If spec_opt
is set to None
it will not add a route to serve the openapi.json
file.
Example:
ⓘ
let settings = revolt_rocket_okapi::settings::OpenApiSettings::new();
let spec = revolt_rocket_okapi::openapi_spec);
let routes = revolt_rocket_okapi::openapi_routes, settings);