pub struct EnumSchema {
pub title: Option<String>,
pub description: Option<String>,
pub one_of: Vec<Schema>,
pub any_of: Vec<Schema>,
pub all_of: Vec<Schema>,
pub discriminator: Option<Discriminator>,
}Expand description
Enum/union schema supporting oneOf, anyOf, allOf, and string enums.
This is used for Rust enums which map to various OpenAPI constructs:
- Unit variants only → string enum with
enumkeyword - Mixed variants →
oneOfwith discriminated union - Untagged enums →
anyOf
Fields§
§title: Option<String>Schema title.
description: Option<String>Schema description.
one_of: Vec<Schema>oneOf schemas (discriminated union - exactly one must match).
any_of: Vec<Schema>anyOf schemas (untagged union - at least one must match).
all_of: Vec<Schema>allOf schemas (intersection - all must match).
discriminator: Option<Discriminator>Discriminator for oneOf schemas.
Trait Implementations§
Source§impl Clone for EnumSchema
impl Clone for EnumSchema
Source§fn clone(&self) -> EnumSchema
fn clone(&self) -> EnumSchema
Returns a duplicate of the value. Read more
1.0.0 · 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 EnumSchema
impl Debug for EnumSchema
Source§impl Default for EnumSchema
impl Default for EnumSchema
Source§fn default() -> EnumSchema
fn default() -> EnumSchema
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for EnumSchema
impl<'de> Deserialize<'de> for EnumSchema
Source§fn 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
Auto Trait Implementations§
impl Freeze for EnumSchema
impl RefUnwindSafe for EnumSchema
impl Send for EnumSchema
impl Sync for EnumSchema
impl Unpin for EnumSchema
impl UnwindSafe for EnumSchema
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).