#[non_exhaustive]pub struct Components {
pub schemas: BTreeMap<String, RefOr<Schema>>,
pub responses: BTreeMap<String, RefOr<Response>>,
pub security_schemes: BTreeMap<String, SecurityScheme>,
pub extensions: Option<Extensions>,
}
Expand description
Implements OpenAPI Components Object which holds supported reusable objects.
Components can hold either reusable types themselves or references to other reusable types.
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.schemas: BTreeMap<String, RefOr<Schema>>
Map of reusable OpenAPI Schema Objects.
responses: BTreeMap<String, RefOr<Response>>
Map of reusable response name, to OpenAPI Response Objects or OpenAPI References to OpenAPI Response Objects.
security_schemes: BTreeMap<String, SecurityScheme>
Map of reusable OpenAPI Security Scheme Objects.
extensions: Option<Extensions>
Optional extensions “x-something”.
Implementations§
Source§impl Components
impl Components
Sourcepub fn builder() -> ComponentsBuilder
pub fn builder() -> ComponentsBuilder
Construct a new ComponentsBuilder.
This is effectively same as calling ComponentsBuilder::new
Source§impl Components
impl Components
Sourcepub fn new() -> Self
pub fn new() -> Self
Construct a new Components
.
Sourcepub fn add_security_scheme<N: Into<String>, S: Into<SecurityScheme>>(
&mut self,
name: N,
security_scheme: S,
)
pub fn add_security_scheme<N: Into<String>, S: Into<SecurityScheme>>( &mut self, name: N, security_scheme: S, )
Add SecurityScheme
to Components
.
Accepts two arguments where first is the name of the SecurityScheme
. This is later when
referenced by SecurityRequirement
s. Second parameter is the SecurityScheme
.
Sourcepub fn add_security_schemes_from_iter<I: IntoIterator<Item = (N, S)>, N: Into<String>, S: Into<SecurityScheme>>(
&mut self,
schemas: I,
)
pub fn add_security_schemes_from_iter<I: IntoIterator<Item = (N, S)>, N: Into<String>, S: Into<SecurityScheme>>( &mut self, schemas: I, )
Add iterator of SecurityScheme
s to Components
.
Accepts two arguments where first is the name of the SecurityScheme
. This is later when
referenced by SecurityRequirement
s. Second parameter is the SecurityScheme
.
Trait Implementations§
Source§impl Clone for Components
impl Clone for Components
Source§fn clone(&self) -> Components
fn clone(&self) -> Components
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more