#[non_exhaustive]pub struct Response {
pub description: String,
pub headers: BTreeMap<String, Header>,
pub content: IndexMap<String, Content>,
pub extensions: Option<Extensions>,
pub links: BTreeMap<String, RefOr<Link>>,
}Expand description
Implements OpenAPI Response Object.
Response is api operation response.
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: StringDescription of the response. Response support markdown syntax.
headers: BTreeMap<String, Header>Map of headers identified by their name. Content-Type header will be ignored.
content: IndexMap<String, Content>Map of response Content objects identified by response body content type e.g application/json.
Contents 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: Option<Extensions>Optional extensions “x-something”.
links: BTreeMap<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 builder() -> ResponseBuilder
pub fn builder() -> ResponseBuilder
Construct a new ResponseBuilder.
This is effectively same as calling ResponseBuilder::new
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Response
impl<'de> Deserialize<'de> for Response
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Response, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Response, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl From<Response> for ResponseBuilder
impl From<Response> for ResponseBuilder
Source§fn from(value: Response) -> ResponseBuilder
fn from(value: Response) -> ResponseBuilder
Converts to this type from the input type.
Source§impl From<ResponseBuilder> for Response
impl From<ResponseBuilder> for Response
Source§fn from(value: ResponseBuilder) -> Response
fn from(value: ResponseBuilder) -> Response
Converts to this type from the input type.
Source§impl Serialize for Response
impl Serialize for Response
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl StructuralPartialEq for Response
Auto Trait Implementations§
impl Freeze for Response
impl RefUnwindSafe for Response
impl Send for Response
impl Sync for Response
impl Unpin for Response
impl UnwindSafe for Response
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more