pub struct ObjectBuilder { /* private fields */ }
Implementations
sourceimpl ObjectBuilder
impl ObjectBuilder
sourcepub fn new() -> ObjectBuilder
pub fn new() -> ObjectBuilder
Constructs a new ObjectBuilder
.
sourcepub fn schema_type(self, schema_type: SchemaType) -> Self
pub fn schema_type(self, schema_type: SchemaType) -> Self
Add or change type of the object e.g SchemaType::String
.
sourcepub fn format(self, format: Option<SchemaFormat>) -> Self
pub fn format(self, format: Option<SchemaFormat>) -> Self
Add or change additional format for detailing the schema type.
sourcepub fn property<S: Into<String>, I: Into<RefOr<Schema>>>(
self,
property_name: S,
component: I
) -> Self
pub fn property<S: Into<String>, I: Into<RefOr<Schema>>>(
self,
property_name: S,
component: I
) -> Self
Add new property to the Object
.
Method accepts property name and property component as an arguments.
pub fn additional_properties<I: Into<RefOr<Schema>>>(
self,
additional_properties: Option<I>
) -> Self
sourcepub fn required<I: Into<String>>(self, required_field: I) -> Self
pub fn required<I: Into<String>>(self, required_field: I) -> Self
Add field to the required fields of 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 Object
.
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 description of the property. Markdown syntax is supported.
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 deprecated(self, deprecated: Option<Deprecated>) -> Self
pub fn deprecated(self, deprecated: Option<Deprecated>) -> Self
Add or change deprecated status for Object
.
sourcepub fn enum_values<I: IntoIterator<Item = E>, E: Into<String>>(
self,
enum_values: Option<I>
) -> Self
pub fn enum_values<I: IntoIterator<Item = E>, E: Into<String>>(
self,
enum_values: Option<I>
) -> Self
Add or change enum property variants.
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 richier documentation.
sourcepub fn write_only(self, write_only: Option<bool>) -> Self
pub fn write_only(self, write_only: Option<bool>) -> Self
Add or change write only flag for Object
.
sourcepub fn read_only(self, read_only: Option<bool>) -> Self
pub fn read_only(self, read_only: Option<bool>) -> Self
Add or change read only flag for Object
.
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
sourceimpl Default for ObjectBuilder
impl Default for ObjectBuilder
sourcefn default() -> ObjectBuilder
fn default() -> ObjectBuilder
Returns the “default value” for a type. Read more
sourceimpl From<Object> for ObjectBuilder
impl From<Object> for ObjectBuilder
sourceimpl From<ObjectBuilder> for Object
impl From<ObjectBuilder> for Object
sourcefn from(value: ObjectBuilder) -> Self
fn from(value: ObjectBuilder) -> Self
Converts to this type from the input type.
sourceimpl From<ObjectBuilder> for RefOr<Schema>
impl From<ObjectBuilder> for RefOr<Schema>
sourcefn from(builder: ObjectBuilder) -> Self
fn from(builder: ObjectBuilder) -> Self
Converts to this type from the input type.
sourceimpl From<ObjectBuilder> for Schema
impl From<ObjectBuilder> for Schema
sourcefn from(builder: ObjectBuilder) -> Self
fn from(builder: ObjectBuilder) -> Self
Converts to this type from the input type.
Auto Trait Implementations
impl RefUnwindSafe for ObjectBuilder
impl Send for ObjectBuilder
impl Sync for ObjectBuilder
impl Unpin for ObjectBuilder
impl UnwindSafe for ObjectBuilder
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more