Struct utoipa::openapi::schema::ObjectBuilder
source · pub struct ObjectBuilder { /* private fields */ }
Implementations§
source§impl ObjectBuilder
impl ObjectBuilder
sourcepub fn new() -> ObjectBuilder
pub fn new() -> ObjectBuilder
Constructs a new ObjectBuilder
.
source§impl ObjectBuilder
impl 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<AdditionalProperties<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<Value>>(
self,
enum_values: Option<I>
) -> Self
pub fn enum_values<I: IntoIterator<Item = E>, E: Into<Value>>( 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 richer 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 multiple_of(self, multiple_of: Option<f64>) -> Self
pub fn multiple_of(self, multiple_of: Option<f64>) -> Self
Set or change multiple_of
validation flag for number
and integer
type values.
sourcepub fn maximum(self, maximum: Option<f64>) -> Self
pub fn maximum(self, maximum: Option<f64>) -> Self
Set or change inclusive maximum value for number
and integer
values.
sourcepub fn minimum(self, minimum: Option<f64>) -> Self
pub fn minimum(self, minimum: Option<f64>) -> Self
Set or change inclusive minimum value for number
and integer
values.
sourcepub fn exclusive_maximum(self, exclusive_maximum: Option<f64>) -> Self
pub fn exclusive_maximum(self, exclusive_maximum: Option<f64>) -> Self
Set or change exclusive maximum value for number
and integer
values.
sourcepub fn exclusive_minimum(self, exclusive_minimum: Option<f64>) -> Self
pub fn exclusive_minimum(self, exclusive_minimum: Option<f64>) -> Self
Set or change exclusive minimum value for number
and integer
values.
sourcepub fn max_length(self, max_length: Option<usize>) -> Self
pub fn max_length(self, max_length: Option<usize>) -> Self
Set or change maximum length for string
values.
sourcepub fn min_length(self, min_length: Option<usize>) -> Self
pub fn min_length(self, min_length: Option<usize>) -> Self
Set or change minimum length for string
values.
sourcepub fn pattern<I: Into<String>>(self, pattern: Option<I>) -> Self
pub fn pattern<I: Into<String>>(self, pattern: Option<I>) -> Self
Set or change a valid regular expression for string
value to match.
sourcepub fn max_properties(self, max_properties: Option<usize>) -> Self
pub fn max_properties(self, max_properties: Option<usize>) -> Self
Set or change maximum number of properties the Object
can hold.
sourcepub fn min_properties(self, min_properties: Option<usize>) -> Self
pub fn min_properties(self, min_properties: Option<usize>) -> Self
Set or change minimum number of properties the Object
can hold.
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
.