pub struct OpenApiParameter {
pub name: String,
pub location: OpenApiParameterLocation,
pub required: bool,
pub schema: OpenApiSchema,
pub description: Option<String>,
pub deprecated: bool,
pub allow_reserved: bool,
pub style: Option<String>,
pub explode: Option<bool>,
pub example: Option<Value>,
pub examples: BTreeMap<String, OpenApiReferenceOr<OpenApiExample>>,
}Expand description
OpenAPI parameter metadata.
Fields§
§name: String§location: OpenApiParameterLocation§required: bool§schema: OpenApiSchema§description: Option<String>§deprecated: bool§allow_reserved: bool§style: Option<String>§explode: Option<bool>§example: Option<Value>§examples: BTreeMap<String, OpenApiReferenceOr<OpenApiExample>>Implementations§
Source§impl OpenApiParameter
impl OpenApiParameter
pub fn new( location: OpenApiParameterLocation, name: impl Into<String>, required: bool, schema: OpenApiSchema, ) -> Self
pub fn path(name: impl Into<String>, schema: OpenApiSchema) -> Self
pub fn query( name: impl Into<String>, required: bool, schema: OpenApiSchema, ) -> Self
pub fn header( name: impl Into<String>, required: bool, schema: OpenApiSchema, ) -> Self
pub fn with_description(self, description: impl Into<String>) -> Self
pub fn with_deprecated(self) -> Self
pub fn with_allow_reserved(self) -> Self
pub fn with_style(self, style: impl Into<String>) -> Self
pub fn with_explode(self, explode: bool) -> Self
pub fn with_example_value(self, example: Value) -> Self
pub fn try_with_example<T>(self, example: T) -> Result<Self>where
T: Serialize,
pub fn with_named_example_value( self, name: impl Into<String>, example: OpenApiExample, ) -> Self
pub fn try_with_named_example<T>(
self,
name: impl Into<String>,
example: T,
) -> Result<Self>where
T: Serialize,
pub fn with_named_example_ref( self, name: impl Into<String>, component_name: impl AsRef<str>, ) -> Self
Trait Implementations§
Source§impl Clone for OpenApiParameter
impl Clone for OpenApiParameter
Source§fn clone(&self) -> OpenApiParameter
fn clone(&self) -> OpenApiParameter
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for OpenApiParameter
impl Debug for OpenApiParameter
Source§impl PartialEq for OpenApiParameter
impl PartialEq for OpenApiParameter
Source§impl Serialize for OpenApiParameter
impl Serialize for OpenApiParameter
impl StructuralPartialEq for OpenApiParameter
Auto Trait Implementations§
impl Freeze for OpenApiParameter
impl RefUnwindSafe for OpenApiParameter
impl Send for OpenApiParameter
impl Sync for OpenApiParameter
impl Unpin for OpenApiParameter
impl UnsafeUnpin for OpenApiParameter
impl UnwindSafe for OpenApiParameter
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