Trait gotham_restful::ResponseSchema
source · pub trait ResponseSchema {
// Required method
fn schema(code: StatusCode) -> OpenapiSchema;
// Provided method
fn status_codes() -> Vec<StatusCode> { ... }
}
Expand description
Additional details for IntoResponse to be used with an OpenAPI-aware router.
Required Methods§
sourcefn schema(code: StatusCode) -> OpenapiSchema
fn schema(code: StatusCode) -> OpenapiSchema
Return the schema of the response for the given status code. The code may only be one that was previously returned by Self::status_codes. The implementation should panic if that is not the case.
Provided Methods§
sourcefn status_codes() -> Vec<StatusCode>
fn status_codes() -> Vec<StatusCode>
All status codes returned by this response. Returns [StatusCode::OK]
by default.
Object Safety§
This trait is not object safe.