@@ -7,20 +7,28 @@ use super::{FromRef, MediaType, Ref, RefError, RefType, Spec};
77/// Describes a single request body.
88///
99/// 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 ) ]
1111pub 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.
1315 ///
1416 /// [CommonMark syntax](https://spec.commonmark.org) MAY be used for rich text representation.
1517 #[ serde( skip_serializing_if = "Option::is_none" ) ]
1618 pub description : Option < String > ,
1719
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
2227 pub content : BTreeMap < String , MediaType > ,
2328
29+ /// Determines if the request body is required in the request.
30+ ///
31+ /// Defaults to false.
2432 #[ serde( skip_serializing_if = "Option::is_none" ) ]
2533 pub required : Option < bool > ,
2634}
0 commit comments