Crate rocket_okapi_codegen
source ·Expand description
This crate is used by rocket_okapi
for code generation. This crate includes the procedural macros like:
#[openapi]
: To generate the documentation for an endpoint/route.openapi_routes![...]
: Returns a closure for generating routes.openapi_spec![...]
: Returns a closure for generating OpenApi objects.#[derive(OpenApiFromRequest)]
: ImplementOpenApiFromRequest
trait for a given struct.
Macros
- Generate and return a closure that can be used to generate the routes.
- Generate and return a closure that can be used to generate the OpenAPI specification.
Attribute Macros
- A proc macro to be used in tandem with one of
Rocket
’s endpoint macros. It requires that all of the arguments of the route implement one of the traits inrocket_okapi::request
, and that the return type implementsOpenApiResponder
.
Derive Macros
- Derive marco for the
OpenApiFromRequest
trait.