Struct utoipa::openapi::schema::OneOfBuilder
source · pub struct OneOfBuilder { /* private fields */ }
Implementations§
source§impl OneOfBuilder
impl OneOfBuilder
sourcepub fn new() -> OneOfBuilder
pub fn new() -> OneOfBuilder
Constructs a new OneOfBuilder
.
source§impl OneOfBuilder
impl OneOfBuilder
sourcepub fn item<I: Into<RefOr<Schema>>>(self, component: I) -> Self
pub fn item<I: Into<RefOr<Schema>>>(self, component: I) -> Self
Adds a given Schema
to OneOf
Composite Object
sourcepub fn title<I: Into<String>>(self, title: Option<I>) -> Self
pub fn title<I: Into<String>>(self, title: Option<I>) -> Self
Add or change the title of the OneOf
.
sourcepub fn description<I: Into<String>>(self, description: Option<I>) -> Self
pub fn description<I: Into<String>>(self, description: Option<I>) -> Self
Add or change optional description for OneOf
component.
sourcepub fn default(self, default: Option<Value>) -> Self
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.
sourcepub fn example(self, example: Option<Value>) -> Self
pub fn example(self, example: Option<Value>) -> Self
Add or change example shown in UI of the value for richer documentation.
sourcepub fn discriminator(self, discriminator: Option<Discriminator>) -> Self
pub fn discriminator(self, discriminator: Option<Discriminator>) -> Self
Add or change discriminator field of the composite OneOf
type.
sourcepub fn to_array_builder(self) -> ArrayBuilder
pub fn to_array_builder(self) -> ArrayBuilder
Construct a new ArrayBuilder
with this component set to ArrayBuilder::items
.
Trait Implementations§
source§impl Default for OneOfBuilder
impl Default for OneOfBuilder
source§impl From<OneOf> for OneOfBuilder
impl From<OneOf> for OneOfBuilder
source§impl From<OneOfBuilder> for OneOf
impl From<OneOfBuilder> for OneOf
source§fn from(value: OneOfBuilder) -> Self
fn from(value: OneOfBuilder) -> Self
Converts to this type from the input type.
source§impl From<OneOfBuilder> for RefOr<Schema>
impl From<OneOfBuilder> for RefOr<Schema>
source§fn from(one_of: OneOfBuilder) -> Self
fn from(one_of: OneOfBuilder) -> Self
Converts to this type from the input type.
source§impl From<OneOfBuilder> for Schema
impl From<OneOfBuilder> for Schema
source§fn from(builder: OneOfBuilder) -> Self
fn from(builder: OneOfBuilder) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for OneOfBuilder
impl RefUnwindSafe for OneOfBuilder
impl Send for OneOfBuilder
impl Sync for OneOfBuilder
impl Unpin for OneOfBuilder
impl UnwindSafe for OneOfBuilder
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