pub struct Operation {
pub name: RustIdent,
pub response_enum: RustIdent,
pub doc: Option<String>,
pub method: String,
pub path: String,
pub path_params: Vec<Param>,
pub query: Option<Struct>,
pub headers: Option<Headers>,
pub cookies: Option<Cookies>,
pub request: Option<RequestPayload>,
pub responses: Vec<ResponseCase>,
pub security: Vec<String>,
}Expand description
A single HTTP operation lowered for code generation.
Fields§
§name: RustIdentApi trait method name (snake_case).
response_enum: RustIdentPer-operation response enum name (<Name>Response).
doc: Option<String>Doc comment derived from the operation summary/description.
method: StringLowercase HTTP method verb (get, post, …), which is also the
axum::routing helper name.
path: StringRequest path template, reused verbatim as the axum route (axum 0.8 and
OpenAPI share the /{name} path-parameter syntax).
path_params: Vec<Param>Typed path parameters, in path order.
query: Option<Struct>Generated query-parameter struct, when the operation declares query
parameters. Its name doubles as the axum_extra::extract::Query<..>
type and the Api method’s query argument type.
headers: Option<Headers>Generated header-parameter struct, when the operation declares header
parameters. Its name doubles as the generated FromRequestParts
extractor type and the Api method’s headers argument type.
Generated cookie-parameter struct, when the operation declares cookie
parameters. Its name doubles as the generated FromRequestParts
extractor type and the Api method’s cookies argument type.
request: Option<RequestPayload>Request payload (a single supported content type, a multipart/form-data
extractor, or a Content-Type-dispatched set of content types), when the
operation declares a request body.
responses: Vec<ResponseCase>Response variants, in declaration order.
security: Vec<String>Keys of the security schemes this operation applies, derived from its
effective security requirement (its own security, else the document’s
global security). Each key matches a SecurityScheme::key. Empty
means the operation is unauthenticated.