Struct utoipa::openapi::schema::AnyOfBuilder

source ·
pub struct AnyOfBuilder { /* private fields */ }
Expand description

Builder for AnyOf with chainable configuration methods to create a new AnyOf.

Implementations§

source§

impl AnyOfBuilder

source

pub fn new() -> AnyOfBuilder

Constructs a new AnyOfBuilder.

source

pub fn build(self) -> AnyOf

Constructs a new AnyOf taking all fields values from this object.

source§

impl AnyOfBuilder

source

pub fn item<I: Into<RefOr<Schema>>>(self, component: I) -> Self

Adds a given Schema to AnyOf Composite Object

source

pub fn description<I: Into<String>>(self, description: Option<I>) -> Self

Add or change optional description for AnyOf component.

source

pub fn default(self, default: Option<Value>) -> Self

Add or change default value for the object which is provided when user has not provided the input in Swagger UI.

source

pub fn example(self, example: Option<Value>) -> Self

Add or change example shown in UI of the value for richer documentation.

source

pub fn discriminator(self, discriminator: Option<Discriminator>) -> Self

Add or change discriminator field of the composite AnyOf type.

source

pub fn nullable(self, nullable: bool) -> Self

Add or change nullable flag for AnyOf.

source

pub fn to_array_builder(self) -> ArrayBuilder

Construct a new ArrayBuilder with this component set to ArrayBuilder::items.

Trait Implementations§

source§

impl Default for AnyOfBuilder

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl From<AnyOf> for AnyOfBuilder

source§

fn from(value: AnyOf) -> Self

Converts to this type from the input type.
source§

impl From<AnyOfBuilder> for AnyOf

source§

fn from(value: AnyOfBuilder) -> Self

Converts to this type from the input type.
source§

impl From<AnyOfBuilder> for RefOr<Schema>

source§

fn from(any_of: AnyOfBuilder) -> Self

Converts to this type from the input type.
source§

impl From<AnyOfBuilder> for Schema

source§

fn from(builder: AnyOfBuilder) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

source§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.