#[non_exhaustive]pub struct Header {
pub schema: Option<RefOr<Schema>>,
pub description: Option<String>,
pub deprecated: Option<Deprecated>,
pub style: Option<ParameterStyle>,
pub explode: Option<bool>,
pub example: Option<Value>,
pub examples: BTreeMap<String, RefOr<Example>>,
pub content: BTreeMap<String, Content>,
pub extensions: Option<Extensions>,
}Expand description
Implements OpenAPI Header Object for response headers.
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.schema: Option<RefOr<Schema>>Schema of header type.
description: Option<String>Additional description of the header value.
deprecated: Option<Deprecated>Declares the header deprecated status.
style: Option<ParameterStyle>Describes how the header value will be serialized.
explode: Option<bool>When true it will generate separate header value for each value with array and object type.
example: Option<Value>Example of the header potential value.
examples: BTreeMap<String, RefOr<Example>>Examples of the header potential values.
content: BTreeMap<String, Content>A map containing the representations for the header.
extensions: Option<Extensions>Optional extensions “x-something”.
Implementations§
Source§impl Header
impl Header
Sourcepub fn builder() -> HeaderBuilder
pub fn builder() -> HeaderBuilder
Construct a new HeaderBuilder.
This is effectively same as calling HeaderBuilder::new
Source§impl Header
impl Header
Sourcepub fn new<C: Into<RefOr<Schema>>>(component: C) -> Self
pub fn new<C: Into<RefOr<Schema>>>(component: C) -> Self
Construct a new Header with custom schema. If you wish to construct a default
header with String type you can use Header::default function.
§Examples
Create new Header with integer type.
let header = Header::new(Object::with_type(Type::Integer));Create a new Header with default type String
let header = Header::default();