@@ -7,20 +7,28 @@ use super::{FromRef, MediaType, Ref, RefError, RefType, Spec};
7
7
/// Describes a single request body.
8
8
///
9
9
/// See <https://github.com/OAI/OpenAPI-Specification/blob/HEAD/versions/3.1.0.md#request-body-object>.
10
- #[ derive( Clone , Debug , Deserialize , Serialize , PartialEq , Default ) ]
10
+ #[ derive( Debug , Clone , Default , PartialEq , Deserialize , Serialize ) ]
11
11
pub struct RequestBody {
12
- /// A brief description of the request body. This could contain examples of use.
12
+ /// A brief description of the request body.
13
+ ///
14
+ /// This could contain examples of use.
13
15
///
14
16
/// [CommonMark syntax](https://spec.commonmark.org) MAY be used for rich text representation.
15
17
#[ serde( skip_serializing_if = "Option::is_none" ) ]
16
18
pub description : Option < String > ,
17
19
18
- /// The content of the request body. The key is a media type or
19
- /// [media type range](https://tools.ietf.org/html/rfc7231#appendix-D) and the
20
- /// value describes it. For requests that match multiple keys, only the most specific key
21
- /// is applicable. e.g. text/plain overrides text/*
20
+ /// The content of the request body.
21
+ ///
22
+ /// The key is a media type or [media type range] and the value describes it. For requests that
23
+ /// match multiple keys, only the most specific key is applicable. E.g., `text/plain` overrides
24
+ /// `text/*`.
25
+ ///
26
+ /// [media type range]: https://tools.ietf.org/html/rfc7231#appendix-D
22
27
pub content : BTreeMap < String , MediaType > ,
23
28
29
+ /// Determines if the request body is required in the request.
30
+ ///
31
+ /// Defaults to false.
24
32
#[ serde( skip_serializing_if = "Option::is_none" ) ]
25
33
pub required : Option < bool > ,
26
34
}
0 commit comments