pub struct Property {
pub component_type: ComponentType,
pub format: Option<ComponentFormat>,
pub description: Option<String>,
pub default: Option<Value>,
pub enum_values: Option<Vec<String>>,
pub example: Option<Value>,
pub deprecated: Option<Deprecated>,
pub write_only: Option<bool>,
pub read_only: Option<bool>,
pub xml: Option<Xml>,
}
Expand description
Implements special subset of OpenAPI Schema Object which can be used to define field property or enum values or type for array items.
Fields
component_type: ComponentType
Type of the property e.g ComponentType::String
.
format: Option<ComponentFormat>
Additional format for detailing the component type.
description: Option<String>
Description of the property. Markdown syntax is supported.
default: Option<Value>
Default value for the property which is provided when user has not provided the input.
enum_values: Option<Vec<String>>
Enum type property possible variants.
example: Option<Value>
Example shown in UI of the value for richier documentation.
deprecated: Option<Deprecated>
Changes the Property
deprecated status.
write_only: Option<bool>
Write only property will be only sent in write requests like POST, PUT.
read_only: Option<bool>
Read only property will be only sent in read requests like GET.
xml: Option<Xml>
Implementations
sourceimpl Property
impl Property
pub fn new(component_type: ComponentType) -> Self
Trait Implementations
sourceimpl<'de> Deserialize<'de> for Property
impl<'de> Deserialize<'de> for Property
sourcefn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
sourceimpl From<Property> for PropertyBuilder
impl From<Property> for PropertyBuilder
sourceimpl From<PropertyBuilder> for Property
impl From<PropertyBuilder> for Property
sourcefn from(value: PropertyBuilder) -> Self
fn from(value: PropertyBuilder) -> Self
Converts to this type from the input type.
Auto Trait Implementations
impl RefUnwindSafe for Property
impl Send for Property
impl Sync for Property
impl Unpin for Property
impl UnwindSafe for Property
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more