pub struct MediaType {
pub schema: Option<ObjectOrReference<ObjectSchema>>,
pub examples: Option<MediaTypeExamples>,
pub encoding: BTreeMap<String, Encoding>,
pub extensions: BTreeMap<String, Value>,
}Expand description
Each Media Type Object provides schema and examples for the media type identified by its key.
Fields§
§schema: Option<ObjectOrReference<ObjectSchema>>§examples: Option<MediaTypeExamples>§encoding: BTreeMap<String, Encoding>§extensions: BTreeMap<String, Value>Implementations§
Source§impl MediaType
impl MediaType
Sourcepub fn schema(
&self,
spec: &OpenApiV31Spec,
) -> Result<Option<ObjectSchema>, ErrorSpec>
pub fn schema( &self, spec: &OpenApiV31Spec, ) -> Result<Option<ObjectSchema>, ErrorSpec>
Resolves and returns the JSON schema definition for this media type.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for MediaType
impl<'de> Deserialize<'de> for MediaType
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl StructuralPartialEq for MediaType
Auto Trait Implementations§
impl Freeze for MediaType
impl RefUnwindSafe for MediaType
impl Send for MediaType
impl Sync for MediaType
impl Unpin for MediaType
impl UnsafeUnpin for MediaType
impl UnwindSafe for MediaType
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