pub struct OpenApiMediaType {
pub schema: OpenApiSchema,
pub example: Option<Value>,
pub examples: BTreeMap<String, OpenApiReferenceOr<OpenApiExample>>,
}Expand description
OpenAPI media type metadata.
Fields§
§schema: OpenApiSchema§example: Option<Value>§examples: BTreeMap<String, OpenApiReferenceOr<OpenApiExample>>Implementations§
Source§impl OpenApiMediaType
impl OpenApiMediaType
pub fn new(schema: OpenApiSchema) -> Self
pub fn with_example_value(self, example: Value) -> Self
pub fn try_with_example<T>(self, example: T) -> Result<Self>where
T: Serialize,
pub fn with_named_example_value( self, name: impl Into<String>, example: OpenApiExample, ) -> Self
pub fn with_named_example_ref( self, name: impl Into<String>, component_name: impl AsRef<str>, ) -> Self
pub fn try_with_named_example<T>(
self,
name: impl Into<String>,
example: T,
) -> Result<Self>where
T: Serialize,
Trait Implementations§
Source§impl Clone for OpenApiMediaType
impl Clone for OpenApiMediaType
Source§fn clone(&self) -> OpenApiMediaType
fn clone(&self) -> OpenApiMediaType
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 OpenApiMediaType
impl Debug for OpenApiMediaType
Source§impl PartialEq for OpenApiMediaType
impl PartialEq for OpenApiMediaType
Source§impl Serialize for OpenApiMediaType
impl Serialize for OpenApiMediaType
impl StructuralPartialEq for OpenApiMediaType
Auto Trait Implementations§
impl Freeze for OpenApiMediaType
impl RefUnwindSafe for OpenApiMediaType
impl Send for OpenApiMediaType
impl Sync for OpenApiMediaType
impl Unpin for OpenApiMediaType
impl UnsafeUnpin for OpenApiMediaType
impl UnwindSafe for OpenApiMediaType
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