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_autodocu::autodocu::openapi3::OpenApi>
settings
:rocket_autodocu::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 = rocket_autodocu::settings::OpenApiSettings::new();
let spec = rocket_autodocu::openapi_spec);
let routes = rocket_autodocu::openapi_routes, settings);