Skip to main content

Crate salvo_oapi_macros

Crate salvo_oapi_macros 

Source
Expand description

Procedural macros used by salvo_oapi.

This crate contains the implementation of the #[endpoint], #[derive(ToSchema)], #[derive(ToParameters)], #[derive(ToResponse)], and #[derive(ToResponses)] macros. Most users should import these macros from salvo_oapi or from salvo with the oapi feature enabled so the generated paths and documentation links line up with the public API.

Attribute Macros§

endpoint
Turns a Salvo handler function into an OpenAPI-aware endpoint.

Derive Macros§

ToParameters
Derives salvo_oapi::ToParameters for a parameter struct.
ToResponse
Derives salvo_oapi::ToResponse for one reusable OpenAPI response.
ToResponses
Derives salvo_oapi::ToResponses for a response map.
ToSchema
Derives salvo_oapi::ToSchema for a Rust type.