Struct salvo_oapi::PathItem
source · #[non_exhaustive]pub struct PathItem {
pub summary: Option<String>,
pub description: Option<String>,
pub servers: Servers,
pub parameters: Parameters,
pub operations: Operations,
}
Expand description
Implements OpenAPI Path Item Object what describes Operation
s available on
a single path.
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.summary: Option<String>
Optional summary intended to apply all operations in this PathItem
.
description: Option<String>
Optional description intended to apply all operations in this PathItem
.
Description supports markdown syntax.
servers: Servers
Alternative Server
array to serve all Operation
s in this PathItem
overriding
the global server array.
parameters: Parameters
List of Parameter
s common to all Operation
s in this PathItem
. Parameters cannot
contain duplicate parameters. They can be overridden in Operation
level but cannot be
removed there.
operations: Operations
Map of operations in this PathItem
. Operations can hold only one operation
per PathItemType
.
Implementations§
source§impl PathItem
impl PathItem
sourcepub fn new<O: Into<Operation>>(
path_item_type: PathItemType,
operation: O,
) -> Self
pub fn new<O: Into<Operation>>( path_item_type: PathItemType, operation: O, ) -> Self
Construct a new PathItem
with provided Operation
mapped to given PathItemType
.
sourcepub fn append(&mut self, other: &mut Self)
pub fn append(&mut self, other: &mut Self)
Moves all elements from other
into self
, leaving other
empty.
If a key from other
is already present in self
, the respective
value from self
will be overwritten with the respective value from other
.
sourcepub fn add_operation<O: Into<Operation>>(
self,
path_item_type: PathItemType,
operation: O,
) -> Self
pub fn add_operation<O: Into<Operation>>( self, path_item_type: PathItemType, operation: O, ) -> Self
Append a new Operation
by PathItemType
to this PathItem
. Operations can
hold only one operation per PathItemType
.
sourcepub fn summary<S: Into<String>>(self, summary: S) -> Self
pub fn summary<S: Into<String>>(self, summary: S) -> Self
Add or change summary intended to apply all operations in this PathItem
.
sourcepub fn description<S: Into<String>>(self, description: S) -> Self
pub fn description<S: Into<String>>(self, description: S) -> Self
Add or change optional description intended to apply all operations in this PathItem
.
Description supports markdown syntax.