Struct utoipa::openapi::request_body::RequestBody
source · #[non_exhaustive]pub struct RequestBody {
pub description: Option<String>,
pub content: BTreeMap<String, Content>,
pub required: Option<Required>,
}
Expand description
Implements OpenAPI Request Body.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. }
syntax; cannot be matched against without a wildcard ..
; and struct update syntax will not work.description: Option<String>
Additional description of RequestBody
supporting markdown syntax.
content: BTreeMap<String, Content>
Map of request body contents mapped by content type e.g. application/json
.
required: Option<Required>
Determines whether request body is required in the request or not.
Implementations§
source§impl RequestBody
impl RequestBody
sourcepub fn new() -> Self
pub fn new() -> Self
Construct a new RequestBody
.
Trait Implementations§
source§impl Clone for RequestBody
impl Clone for RequestBody
source§fn clone(&self) -> RequestBody
fn clone(&self) -> RequestBody
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Default for RequestBody
impl Default for RequestBody
source§fn default() -> RequestBody
fn default() -> RequestBody
Returns the “default value” for a type. Read more
source§impl<'de> Deserialize<'de> for RequestBody
impl<'de> Deserialize<'de> for RequestBody
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
source§impl From<RequestBody> for RequestBodyBuilder
impl From<RequestBody> for RequestBodyBuilder
source§fn from(value: RequestBody) -> Self
fn from(value: RequestBody) -> Self
Converts to this type from the input type.
source§impl From<RequestBodyBuilder> for RequestBody
impl From<RequestBodyBuilder> for RequestBody
source§fn from(value: RequestBodyBuilder) -> Self
fn from(value: RequestBodyBuilder) -> Self
Converts to this type from the input type.
source§impl PartialEq<RequestBody> for RequestBody
impl PartialEq<RequestBody> for RequestBody
source§fn eq(&self, other: &RequestBody) -> bool
fn eq(&self, other: &RequestBody) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl RequestBodyExt for RequestBody
impl RequestBodyExt for RequestBody
source§fn json_schema_ref(self, ref_name: &str) -> RequestBody
fn json_schema_ref(self, ref_name: &str) -> RequestBody
Available on crate feature
openapi_extensions
only.