#[non_exhaustive]pub struct Response {
pub description: String,
pub headers: PropMap<String, Header>,
pub contents: IndexMap<String, Content>,
pub extensions: PropMap<String, Value>,
pub links: PropMap<String, RefOr<Link>>,
}
Expand description
Implements OpenAPI Response Object.
Response is api operation response.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. }
syntax; cannot be matched against without a wildcard ..
; and struct update syntax will not work.description: String
Description of the response. Response support markdown syntax.
headers: PropMap<String, Header>
Map of headers identified by their name. Content-Type
header will be ignored.
contents: IndexMap<String, Content>
Map of response Content
objects identified by response body content type e.g application/json
.
Content
s are stored within IndexMap
to retain their insertion order. Swagger UI
will create and show default example according to the first entry in content
map.
extensions: PropMap<String, Value>
Optional extensions “x-something”
links: PropMap<String, RefOr<Link>>
A map of operations links that can be followed from the response. The key of the map is a short name for the link.
Implementations§
Source§impl Response
impl Response
Sourcepub fn new<S: Into<String>>(description: S) -> Self
pub fn new<S: Into<String>>(description: S) -> Self
Construct a new Response
.
Function takes description as argument.
Sourcepub fn description<I: Into<String>>(self, description: I) -> Self
pub fn description<I: Into<String>>(self, description: I) -> Self
Add description. Description supports markdown syntax.
Sourcepub fn add_header<S: Into<String>>(self, name: S, header: Header) -> Self
pub fn add_header<S: Into<String>>(self, name: S, header: Header) -> Self
Add response Header
and returns Self
.