Struct schemars::visit::SetSingleExample
source · pub struct SetSingleExample {
pub retain_examples: bool,
}
Expand description
This visitor will remove the examples
schema property and (if present) set its first value as the example
property.
This is useful for dialects of JSON Schema (e.g. OpenAPI 3.0) that do not support the examples
property.
Fields§
§retain_examples: bool
When set to true
, the examples
property will not be removed, but its first value will still be copied to example
.
Trait Implementations§
source§impl Clone for SetSingleExample
impl Clone for SetSingleExample
source§fn clone(&self) -> SetSingleExample
fn clone(&self) -> SetSingleExample
Returns a copy 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 SetSingleExample
impl Debug for SetSingleExample
source§impl Visitor for SetSingleExample
impl Visitor for SetSingleExample
source§fn visit_schema_object(&mut self, schema: &mut SchemaObject)
fn visit_schema_object(&mut self, schema: &mut SchemaObject)
Override this method to modify a
SchemaObject
and (optionally) its subschemas. Read moresource§fn visit_root_schema(&mut self, root: &mut RootSchema)
fn visit_root_schema(&mut self, root: &mut RootSchema)
Override this method to modify a
RootSchema
and (optionally) its subschemas. Read moreAuto Trait Implementations§
impl Freeze for SetSingleExample
impl RefUnwindSafe for SetSingleExample
impl Send for SetSingleExample
impl Sync for SetSingleExample
impl Unpin for SetSingleExample
impl UnwindSafe for SetSingleExample
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§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)