pub struct OpenApiResponse {
pub description: String,
pub headers: BTreeMap<String, OpenApiReferenceOr<OpenApiHeader>>,
pub content: BTreeMap<String, OpenApiMediaType>,
}Expand description
OpenAPI response metadata.
Fields§
§description: String§headers: BTreeMap<String, OpenApiReferenceOr<OpenApiHeader>>§content: BTreeMap<String, OpenApiMediaType>Implementations§
Source§impl OpenApiResponse
impl OpenApiResponse
pub fn description(description: impl Into<String>) -> Self
pub fn content( description: impl Into<String>, content_type: impl Into<String>, schema: OpenApiSchema, ) -> Self
pub fn json(description: impl Into<String>, schema: OpenApiSchema) -> Self
pub fn try_content_example<T>(
description: impl Into<String>,
content_type: impl Into<String>,
schema: OpenApiSchema,
example: T,
) -> Result<Self>where
T: Serialize,
pub fn try_json_example<T>(
description: impl Into<String>,
schema: OpenApiSchema,
example: T,
) -> Result<Self>where
T: Serialize,
pub fn try_with_content_example<T>(
self,
content_type: impl Into<String>,
example: T,
) -> Result<Self>where
T: Serialize,
pub fn try_with_content_named_example<T>(
self,
content_type: impl Into<String>,
name: impl Into<String>,
example: T,
) -> Result<Self>where
T: Serialize,
pub fn with_content_named_example_ref( self, content_type: impl Into<String>, name: impl Into<String>, component_name: impl AsRef<str>, ) -> Self
pub fn try_with_json_example<T>(self, example: T) -> Result<Self>where
T: Serialize,
pub fn try_with_json_named_example<T>(
self,
name: impl Into<String>,
example: T,
) -> Result<Self>where
T: Serialize,
pub fn with_json_named_example_ref( self, name: impl Into<String>, component_name: impl AsRef<str>, ) -> Self
pub fn with_header(self, name: impl Into<String>, header: OpenApiHeader) -> Self
pub fn with_header_ref( self, name: impl Into<String>, component_name: impl AsRef<str>, ) -> Self
Trait Implementations§
Source§impl Clone for OpenApiResponse
impl Clone for OpenApiResponse
Source§fn clone(&self) -> OpenApiResponse
fn clone(&self) -> OpenApiResponse
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for OpenApiResponse
impl Debug for OpenApiResponse
Source§impl PartialEq for OpenApiResponse
impl PartialEq for OpenApiResponse
Source§impl Serialize for OpenApiResponse
impl Serialize for OpenApiResponse
impl StructuralPartialEq for OpenApiResponse
Auto Trait Implementations§
impl Freeze for OpenApiResponse
impl RefUnwindSafe for OpenApiResponse
impl Send for OpenApiResponse
impl Sync for OpenApiResponse
impl Unpin for OpenApiResponse
impl UnsafeUnpin for OpenApiResponse
impl UnwindSafe for OpenApiResponse
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more