Expand description
Lowering OpenAPI paths/operations into the server crate::ir::Service.
Each operation is lowered into typed inputs (path/query/header parameters and a JSON request body) plus a response enum. The generator only models what it can translate faithfully. Anything else is rejected with an error rather than mis-generated.
Supported:
- Path parameters — inline scalars, or a same-document
$refto a scalar. - Query parameters — scalars and arrays of scalars, lowered into a
per-operation
Deserializestruct extracted viaaxum_extra::extract::Query. Required parameters stay bare. optional ones becomeOption<..>. Arrays must use the defaultform/explode: trueencoding (repeated keys). - Header parameters — scalars only, lowered into a per-operation struct
extracted via a generated
FromRequestPartsimpl. The reservedAccept/Content-Type/Authorizationheaders are ignored. - Cookie parameters — scalars only, lowered into a per-operation struct
extracted via a generated
FromRequestPartsimpl backed byaxum_extra’sCookieJar. - Component
$refparameters and request bodies —$refs to#/components/parameters/*and#/components/requestBodies/*are resolved against the document. - Responses — explicit status codes, the
defaultcatch-all, and ranges (5XX). Component$refresponses are resolved against the document. - Cross-file
$refparameters, request bodies, and responses — the referenced structural object is read from the sibling file (resolved relative to the main spec’s directory), following chains across files. Parameter inner schemas must still resolve to scalars. body/response inner schema$refs route through theimport-mappingto an external type (they are never inlined).
Rejected: object or other non-scalar parameters, non-default query-array
encodings, content parameters, array or byte/binary header parameters,
byte/binary cookie parameters, path-item $refs, cross-file schema-type
$refs (in a body or response) that lack an import-mapping entry for the
referenced file, and an unrecognised response status code.
Functions§
- generate_
service - Lower every operation in
specinto the server IR, resolving cross-file schema references throughimport_mapping.response_type_suffixis appended to each operation’s response-enum name.