pub struct ContentBuilder { /* private fields */ }Implementations§
Source§impl ContentBuilder
impl ContentBuilder
Sourcepub fn new() -> ContentBuilder
pub fn new() -> ContentBuilder
Constructs a new ContentBuilder.
Source§impl ContentBuilder
impl ContentBuilder
Sourcepub fn item_schema<I: Into<RefOr<Schema>>>(self, item_schema: Option<I>) -> Self
pub fn item_schema<I: Into<RefOr<Schema>>>(self, item_schema: Option<I>) -> Self
Add item schema for a streaming or event-based media type.
Sourcepub fn description<I: Into<String>>(self, description: Option<I>) -> Self
pub fn description<I: Into<String>>(self, description: Option<I>) -> Self
Add or change description of this media type.
Sourcepub fn examples_from_iter<E: IntoIterator<Item = (N, V)>, N: Into<String>, V: Into<RefOr<Example>>>(
self,
examples: E,
) -> Self
pub fn examples_from_iter<E: IntoIterator<Item = (N, V)>, N: Into<String>, V: Into<RefOr<Example>>>( self, examples: E, ) -> Self
Add iterator of (N, V) where N is name of example and V is Example to
Content of a request body or response body.
Content::examples and Content::example are mutually exclusive. If both are defined
examples will override value in example.
Sourcepub fn encoding<S: Into<String>, E: Into<Encoding>>(
self,
property_name: S,
encoding: E,
) -> Self
pub fn encoding<S: Into<String>, E: Into<Encoding>>( self, property_name: S, encoding: E, ) -> Self
Add an encoding.
The property_name MUST exist in the Content::schema as a property,
with schema being a Schema::Object and this object containing the same property
key in Object::properties.
The encoding object SHALL only apply to request_body objects when the media type is
multipart or application/x-www-form-urlencoded.
Sourcepub fn prefix_encoding<I: IntoIterator<Item = E>, E: Into<Encoding>>(
self,
prefix_encoding: I,
) -> Self
pub fn prefix_encoding<I: IntoIterator<Item = E>, E: Into<Encoding>>( self, prefix_encoding: I, ) -> Self
Add encoding information for tuple-like sequential or array items.
Sourcepub fn item_encoding<E: Into<Encoding>>(self, item_encoding: Option<E>) -> Self
pub fn item_encoding<E: Into<Encoding>>(self, item_encoding: Option<E>) -> Self
Add encoding information for each item in a sequential or array media type.
Sourcepub fn extensions(self, extensions: Option<Extensions>) -> Self
pub fn extensions(self, extensions: Option<Extensions>) -> Self
Add openapi extensions (x-something) of the API.