pub enum Items {
Single(Box<Schema>),
Positional(Vec<Schema>),
}Expand description
The items keyword.
JSON Schema 2020-12 spells it as a single schema applied to every element.
Draft-04 also allowed a positional array — the tuple form — and tooling
that predates 2020-12 (FastAPI/pydantic v1 emits it under
openapi: "3.1.0") still writes items: [A, B] where 2020-12 would write
prefixItems: [A, B]. Both spellings parse; consumers reach positional
entries through SchemaDetails::positional_items, which unifies them
with prefixItems.
Variants§
Single(Box<Schema>)
2020-12 items: one schema for every element.
Positional(Vec<Schema>)
Draft-04 tuple form: one schema per position.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Items
impl<'de> Deserialize<'de> for Items
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 Items
impl RefUnwindSafe for Items
impl Send for Items
impl Sync for Items
impl Unpin for Items
impl UnsafeUnpin for Items
impl UnwindSafe for Items
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