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)]: Implement OpenApiFromRequest 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 in rocket_okapi::request, and that the return type implements OpenApiResponder.

Derive Macros