utoipa::openapi::schema

Struct AllOfBuilder

Source
pub struct AllOfBuilder { /* private fields */ }
Expand description

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

Implementations§

Source§

impl AllOfBuilder

Source

pub fn new() -> AllOfBuilder

Constructs a new AllOfBuilder.

Source

pub fn build(self) -> AllOf

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

Source§

impl AllOfBuilder

Source

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

Adds a given Schema to AllOf Composite Object.

Source

pub fn schema_type<T: Into<SchemaType>>(self, schema_type: T) -> Self

Add or change type of the object e.g. to change type to string use value SchemaType::Type(Type::String).

Source

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

Add or change the title of the AllOf.

Source

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

Add or change optional description for AllOf 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

👎Deprecated: Since OpenAPI 3.1 prefer using examples

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

Deprecated since 3.0.x. Prefer AllOfBuilder::examples instead

Source

pub fn examples<I: IntoIterator<Item = V>, V: Into<Value>>( self, examples: I, ) -> Self

Add or change examples 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 AllOf type.

Source

pub fn extensions(self, extensions: Option<Extensions>) -> Self

Add openapi extensions (x-something) for AllOf.

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 AllOfBuilder

Source§

fn default() -> Self

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

impl From<AllOf> for AllOfBuilder

Source§

fn from(value: AllOf) -> Self

Converts to this type from the input type.
Source§

impl From<AllOfBuilder> for AdditionalProperties<Schema>

Source§

fn from(value: AllOfBuilder) -> Self

Converts to this type from the input type.
Source§

impl From<AllOfBuilder> for AllOf

Source§

fn from(value: AllOfBuilder) -> Self

Converts to this type from the input type.
Source§

impl From<AllOfBuilder> for ArrayItems

Source§

fn from(value: AllOfBuilder) -> Self

Converts to this type from the input type.
Source§

impl From<AllOfBuilder> for RefOr<Schema>

Source§

fn from(one_of: AllOfBuilder) -> Self

Converts to this type from the input type.
Source§

impl From<AllOfBuilder> for Schema

Source§

fn from(builder: AllOfBuilder) -> 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.