pub struct OpenApiRouteConfig { /* private fields */ }Expand description
Per-route OpenAPI metadata.
Implementations§
Source§impl OpenApiRouteConfig
impl OpenApiRouteConfig
Adds multiple tags to the operation.
Sourcepub fn with_summary(self, summary: impl Into<String>) -> Self
pub fn with_summary(self, summary: impl Into<String>) -> Self
Sets the operation summary.
Sourcepub fn with_description(self, description: impl Into<String>) -> Self
pub fn with_description(self, description: impl Into<String>) -> Self
Sets the operation description.
Sourcepub fn with_operation_id(self, operation_id: impl Into<String>) -> Self
pub fn with_operation_id(self, operation_id: impl Into<String>) -> Self
Sets the operation id.
Sourcepub fn with_request_schema(self, schema: OpenApiSchema) -> Self
pub fn with_request_schema(self, schema: OpenApiSchema) -> Self
Sets the request body schema for this operation.
Sourcepub fn with_response_schema(
self,
status: impl IntoStatusCode,
schema: OpenApiSchema,
) -> Self
pub fn with_response_schema( self, status: impl IntoStatusCode, schema: OpenApiSchema, ) -> Self
Sets the response schema for this operation.
Sourcepub fn consumes_named_path<T: DeserializeOwned>(self) -> Self
pub fn consumes_named_path<T: DeserializeOwned>(self) -> Self
Generates path parameters schema.
Sourcepub fn consumes_query<T: DeserializeOwned>(self) -> Self
pub fn consumes_query<T: DeserializeOwned>(self) -> Self
Generates query parameters schema.
Sourcepub fn consumes_json<T: DeserializeOwned>(self) -> Self
pub fn consumes_json<T: DeserializeOwned>(self) -> Self
Generates JSON request schema and example.
Sourcepub fn consumes_form<T: DeserializeOwned>(self) -> Self
pub fn consumes_form<T: DeserializeOwned>(self) -> Self
Generates form request schema and example.
Sourcepub fn consumes_multipart(self) -> Self
pub fn consumes_multipart(self) -> Self
Generates multipart request schema.
Sourcepub fn consumes_stream(self) -> Self
pub fn consumes_stream(self) -> Self
Generates stream request schema.
Sourcepub fn produces_text(self, status: impl IntoStatusCode) -> Self
pub fn produces_text(self, status: impl IntoStatusCode) -> Self
Generates text/plain response schema.
Sourcepub fn produces_no_schema(self, status: impl IntoStatusCode) -> Self
pub fn produces_no_schema(self, status: impl IntoStatusCode) -> Self
Generates a response without a schema.
Sourcepub fn produces_json<T: Serialize + Default>(
self,
status: impl IntoStatusCode,
) -> Self
pub fn produces_json<T: Serialize + Default>( self, status: impl IntoStatusCode, ) -> Self
Generates JSON response schema and example from T::default().
Sourcepub fn produces_empty_json(self, status: impl IntoStatusCode) -> Self
pub fn produces_empty_json(self, status: impl IntoStatusCode) -> Self
Generates empty JSON response schema.
Sourcepub fn produces_form<T: Serialize + Default>(
self,
status: impl IntoStatusCode,
) -> Self
pub fn produces_form<T: Serialize + Default>( self, status: impl IntoStatusCode, ) -> Self
Generates form response schema and example from T::default().
Sourcepub fn produces_empty_form(self, status: impl IntoStatusCode) -> Self
pub fn produces_empty_form(self, status: impl IntoStatusCode) -> Self
Generates empty form response schema.
Sourcepub fn produces_stream(self, status: impl IntoStatusCode) -> Self
pub fn produces_stream(self, status: impl IntoStatusCode) -> Self
Generates stream response schema.
Sourcepub fn produces_sse(self, status: impl IntoStatusCode) -> Self
pub fn produces_sse(self, status: impl IntoStatusCode) -> Self
Generates SSE stream response schema.
Sourcepub fn produces_json_example<T: Serialize>(
self,
status: impl IntoStatusCode,
example: T,
) -> Self
pub fn produces_json_example<T: Serialize>( self, status: impl IntoStatusCode, example: T, ) -> Self
Generates JSON response schema and example.
Sourcepub fn produces_form_example<T: Serialize>(
self,
status: impl IntoStatusCode,
example: T,
) -> Self
pub fn produces_form_example<T: Serialize>( self, status: impl IntoStatusCode, example: T, ) -> Self
Generates form response schema and example.
Trait Implementations§
Source§impl Clone for OpenApiRouteConfig
impl Clone for OpenApiRouteConfig
Source§fn clone(&self) -> OpenApiRouteConfig
fn clone(&self) -> OpenApiRouteConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more