pub trait DocResponseBody {
// Required method
fn describe(op: &mut Operation, schemas: &mut Vec<(String, RefOr<Schema>)>);
}Expand description
Describe how a handler’s return type contributes to its OpenAPI operation’s 200 response.
Invoked once per handler at spec-build time via the
[crate::__private::ResponseBodyContribution] autoref dispatch.
Implementors mutate op.responses.responses (typically inserting
an entry at "200") and append any schema components the response
references to schemas so they can be registered on
components.schemas by the surrounding
crate::ApidocHandlerSchemas machinery.
The blanket impl on Result<Ok, Err> means handlers returning
Result<Foo, MyError> transparently defer to Foo’s impl; the
error half is handled separately by utoipa’s
utoipa::IntoResponses from the macro’s existing responses(E)
emission.
Required Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.