pub struct ParamInfo {
pub name: String,
pub converter: Converter,
pub title: Option<String>,
pub description: Option<String>,
pub deprecated: bool,
pub example: Option<Value>,
pub examples: Vec<(String, Value)>,
}Expand description
Path parameter information with optional OpenAPI metadata.
Fields§
§name: StringParameter name.
converter: ConverterType converter.
title: Option<String>Title for display in OpenAPI documentation.
description: Option<String>Description for OpenAPI documentation.
deprecated: boolWhether the parameter is deprecated.
example: Option<Value>Example value for OpenAPI documentation.
examples: Vec<(String, Value)>Named examples for OpenAPI documentation.
Implementations§
Source§impl ParamInfo
impl ParamInfo
Sourcepub fn new(name: impl Into<String>, converter: Converter) -> Self
pub fn new(name: impl Into<String>, converter: Converter) -> Self
Create a new parameter info with name and converter.
Sourcepub fn with_title(self, title: impl Into<String>) -> Self
pub fn with_title(self, title: impl Into<String>) -> Self
Set the title for OpenAPI documentation.
Sourcepub fn with_description(self, description: impl Into<String>) -> Self
pub fn with_description(self, description: impl Into<String>) -> Self
Set the description for OpenAPI documentation.
Sourcepub fn deprecated(self) -> Self
pub fn deprecated(self) -> Self
Mark the parameter as deprecated.
Sourcepub fn with_example(self, example: Value) -> Self
pub fn with_example(self, example: Value) -> Self
Set an example value for OpenAPI documentation.
Sourcepub fn with_named_example(self, name: impl Into<String>, value: Value) -> Self
pub fn with_named_example(self, name: impl Into<String>, value: Value) -> Self
Add a named example for OpenAPI documentation.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ParamInfo
impl RefUnwindSafe for ParamInfo
impl Send for ParamInfo
impl Sync for ParamInfo
impl Unpin for ParamInfo
impl UnwindSafe for ParamInfo
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, _span: NoopSpan) -> Self
fn instrument(self, _span: NoopSpan) -> Self
Instruments this future with a span (no-op when disabled).
Source§fn in_current_span(self) -> Self
fn in_current_span(self) -> Self
Instruments this future with the current span (no-op when disabled).