pub struct ObjectBuilder<S: State = Empty> { /* private fields */ }
Expand description
Use builder syntax to set the inputs and finish with build()
.
Implementations§
Source§impl<S: State> ObjectBuilder<S>
impl<S: State> ObjectBuilder<S>
Sourcepub fn build(self) -> Objectwhere
S: IsComplete,
pub fn build(self) -> Objectwhere
S: IsComplete,
Finish building and return the requested object
Sourcepub fn id(self, value: impl Into<String>) -> ObjectBuilder<SetId<S>>where
S::Id: IsUnset,
pub fn id(self, value: impl Into<String>) -> ObjectBuilder<SetId<S>>where
S::Id: IsUnset,
Optional (Some / Option setters). Default: ""
.
The $id
keyword defines a unique identifier for the schema.
https://www.learnjsonschema.com/2020-12/meta-data/id/
Sourcepub fn maybe_id(
self,
value: Option<impl Into<String>>,
) -> ObjectBuilder<SetId<S>>where
S::Id: IsUnset,
pub fn maybe_id(
self,
value: Option<impl Into<String>>,
) -> ObjectBuilder<SetId<S>>where
S::Id: IsUnset,
Optional (Some / Option setters). Default: ""
.
The $id
keyword defines a unique identifier for the schema.
https://www.learnjsonschema.com/2020-12/meta-data/id/
Sourcepub fn schema(self, value: impl Into<Schema>) -> ObjectBuilder<SetSchema<S>>where
S::Schema: IsUnset,
pub fn schema(self, value: impl Into<Schema>) -> ObjectBuilder<SetSchema<S>>where
S::Schema: IsUnset,
Optional (Some / Option setters).
The $schema
keyword declares the JSON Schema version.
https://www.learnjsonschema.com/2020-12/meta-data/schema/
Sourcepub fn maybe_schema(
self,
value: Option<impl Into<Schema>>,
) -> ObjectBuilder<SetSchema<S>>where
S::Schema: IsUnset,
pub fn maybe_schema(
self,
value: Option<impl Into<Schema>>,
) -> ObjectBuilder<SetSchema<S>>where
S::Schema: IsUnset,
Optional (Some / Option setters).
The $schema
keyword declares the JSON Schema version.
https://www.learnjsonschema.com/2020-12/meta-data/schema/
Sourcepub fn reference(
self,
value: impl Into<String>,
) -> ObjectBuilder<SetReference<S>>where
S::Reference: IsUnset,
pub fn reference(
self,
value: impl Into<String>,
) -> ObjectBuilder<SetReference<S>>where
S::Reference: IsUnset,
Optional (Some / Option setters). Default: ""
.
The $ref
keyword references an external or internal schema by URI.
https://www.learnjsonschema.com/2020-12/structure/$ref/
Sourcepub fn maybe_reference(
self,
value: Option<impl Into<String>>,
) -> ObjectBuilder<SetReference<S>>where
S::Reference: IsUnset,
pub fn maybe_reference(
self,
value: Option<impl Into<String>>,
) -> ObjectBuilder<SetReference<S>>where
S::Reference: IsUnset,
Optional (Some / Option setters). Default: ""
.
The $ref
keyword references an external or internal schema by URI.
https://www.learnjsonschema.com/2020-12/structure/$ref/
Sourcepub fn comment(self, value: impl Into<String>) -> ObjectBuilder<SetComment<S>>where
S::Comment: IsUnset,
pub fn comment(self, value: impl Into<String>) -> ObjectBuilder<SetComment<S>>where
S::Comment: IsUnset,
Optional (Some / Option setters). Default: ""
.
The $comment
keyword provides annotations for documentation.
https://www.learnjsonschema.com/2020-12/meta-data/comment/
Sourcepub fn maybe_comment(
self,
value: Option<impl Into<String>>,
) -> ObjectBuilder<SetComment<S>>where
S::Comment: IsUnset,
pub fn maybe_comment(
self,
value: Option<impl Into<String>>,
) -> ObjectBuilder<SetComment<S>>where
S::Comment: IsUnset,
Optional (Some / Option setters). Default: ""
.
The $comment
keyword provides annotations for documentation.
https://www.learnjsonschema.com/2020-12/meta-data/comment/
Sourcepub fn title(self, value: impl Into<String>) -> ObjectBuilder<SetTitle<S>>where
S::Title: IsUnset,
pub fn title(self, value: impl Into<String>) -> ObjectBuilder<SetTitle<S>>where
S::Title: IsUnset,
Optional (Some / Option setters). Default: ""
.
The title
keyword provides a short descriptive title.
https://www.learnjsonschema.com/2020-12/meta-data/title/
Sourcepub fn maybe_title(
self,
value: Option<impl Into<String>>,
) -> ObjectBuilder<SetTitle<S>>where
S::Title: IsUnset,
pub fn maybe_title(
self,
value: Option<impl Into<String>>,
) -> ObjectBuilder<SetTitle<S>>where
S::Title: IsUnset,
Optional (Some / Option setters). Default: ""
.
The title
keyword provides a short descriptive title.
https://www.learnjsonschema.com/2020-12/meta-data/title/
Sourcepub fn description(
self,
value: impl Into<String>,
) -> ObjectBuilder<SetDescription<S>>where
S::Description: IsUnset,
pub fn description(
self,
value: impl Into<String>,
) -> ObjectBuilder<SetDescription<S>>where
S::Description: IsUnset,
Optional (Some / Option setters). Default: ""
.
The description
keyword provides a detailed description.
https://www.learnjsonschema.com/2020-12/meta-data/description/
Sourcepub fn maybe_description(
self,
value: Option<impl Into<String>>,
) -> ObjectBuilder<SetDescription<S>>where
S::Description: IsUnset,
pub fn maybe_description(
self,
value: Option<impl Into<String>>,
) -> ObjectBuilder<SetDescription<S>>where
S::Description: IsUnset,
Optional (Some / Option setters). Default: ""
.
The description
keyword provides a detailed description.
https://www.learnjsonschema.com/2020-12/meta-data/description/
Sourcepub fn summary(self, value: impl Into<String>) -> ObjectBuilder<SetSummary<S>>where
S::Summary: IsUnset,
pub fn summary(self, value: impl Into<String>) -> ObjectBuilder<SetSummary<S>>where
S::Summary: IsUnset,
Optional (Some / Option setters). Default: ""
.
The summary
keyword offers a brief summary for documentation.
https://www.learnjsonschema.com/2020-12/meta-data/summary/
Sourcepub fn maybe_summary(
self,
value: Option<impl Into<String>>,
) -> ObjectBuilder<SetSummary<S>>where
S::Summary: IsUnset,
pub fn maybe_summary(
self,
value: Option<impl Into<String>>,
) -> ObjectBuilder<SetSummary<S>>where
S::Summary: IsUnset,
Optional (Some / Option setters). Default: ""
.
The summary
keyword offers a brief summary for documentation.
https://www.learnjsonschema.com/2020-12/meta-data/summary/
Sourcepub fn default(self, value: impl Into<Value>) -> ObjectBuilder<SetDefault<S>>where
S::Default: IsUnset,
pub fn default(self, value: impl Into<Value>) -> ObjectBuilder<SetDefault<S>>where
S::Default: IsUnset,
Optional (Some / Option setters).
The default
keyword provides a default instance value.
https://www.learnjsonschema.com/2020-12/validation/default/
Sourcepub fn maybe_default(
self,
value: Option<impl Into<Value>>,
) -> ObjectBuilder<SetDefault<S>>where
S::Default: IsUnset,
pub fn maybe_default(
self,
value: Option<impl Into<Value>>,
) -> ObjectBuilder<SetDefault<S>>where
S::Default: IsUnset,
Optional (Some / Option setters).
The default
keyword provides a default instance value.
https://www.learnjsonschema.com/2020-12/validation/default/
Sourcepub fn read_only(self, value: impl Into<bool>) -> ObjectBuilder<SetReadOnly<S>>where
S::ReadOnly: IsUnset,
pub fn read_only(self, value: impl Into<bool>) -> ObjectBuilder<SetReadOnly<S>>where
S::ReadOnly: IsUnset,
Optional (Some / Option setters).
The readOnly
keyword marks a property as read-only.
https://www.learnjsonschema.com/2020-12/validation/readOnly/
Sourcepub fn maybe_read_only(
self,
value: Option<impl Into<bool>>,
) -> ObjectBuilder<SetReadOnly<S>>where
S::ReadOnly: IsUnset,
pub fn maybe_read_only(
self,
value: Option<impl Into<bool>>,
) -> ObjectBuilder<SetReadOnly<S>>where
S::ReadOnly: IsUnset,
Optional (Some / Option setters).
The readOnly
keyword marks a property as read-only.
https://www.learnjsonschema.com/2020-12/validation/readOnly/
Sourcepub fn deprecated(
self,
value: impl Into<bool>,
) -> ObjectBuilder<SetDeprecated<S>>where
S::Deprecated: IsUnset,
pub fn deprecated(
self,
value: impl Into<bool>,
) -> ObjectBuilder<SetDeprecated<S>>where
S::Deprecated: IsUnset,
Optional (Some / Option setters).
The deprecated
keyword marks a schema as deprecated.
https://www.learnjsonschema.com/2020-12/meta-data/deprecated/
Sourcepub fn maybe_deprecated(
self,
value: Option<impl Into<bool>>,
) -> ObjectBuilder<SetDeprecated<S>>where
S::Deprecated: IsUnset,
pub fn maybe_deprecated(
self,
value: Option<impl Into<bool>>,
) -> ObjectBuilder<SetDeprecated<S>>where
S::Deprecated: IsUnset,
Optional (Some / Option setters).
The deprecated
keyword marks a schema as deprecated.
https://www.learnjsonschema.com/2020-12/meta-data/deprecated/
Sourcepub fn write_only(
self,
value: impl Into<bool>,
) -> ObjectBuilder<SetWriteOnly<S>>where
S::WriteOnly: IsUnset,
pub fn write_only(
self,
value: impl Into<bool>,
) -> ObjectBuilder<SetWriteOnly<S>>where
S::WriteOnly: IsUnset,
Optional (Some / Option setters).
The writeOnly
keyword marks a property as write-only.
https://www.learnjsonschema.com/2020-12/validation/writeOnly/
Sourcepub fn maybe_write_only(
self,
value: Option<impl Into<bool>>,
) -> ObjectBuilder<SetWriteOnly<S>>where
S::WriteOnly: IsUnset,
pub fn maybe_write_only(
self,
value: Option<impl Into<bool>>,
) -> ObjectBuilder<SetWriteOnly<S>>where
S::WriteOnly: IsUnset,
Optional (Some / Option setters).
The writeOnly
keyword marks a property as write-only.
https://www.learnjsonschema.com/2020-12/validation/writeOnly/
Sourcepub fn multiple_of(
self,
value: impl Into<OrderedFloat<f64>>,
) -> ObjectBuilder<SetMultipleOf<S>>where
S::MultipleOf: IsUnset,
pub fn multiple_of(
self,
value: impl Into<OrderedFloat<f64>>,
) -> ObjectBuilder<SetMultipleOf<S>>where
S::MultipleOf: IsUnset,
Optional (Some / Option setters).
The multipleOf
keyword ensures the number is a multiple of this value.
https://www.learnjsonschema.com/2020-12/validation/multipleOf/
Sourcepub fn maybe_multiple_of(
self,
value: Option<impl Into<OrderedFloat<f64>>>,
) -> ObjectBuilder<SetMultipleOf<S>>where
S::MultipleOf: IsUnset,
pub fn maybe_multiple_of(
self,
value: Option<impl Into<OrderedFloat<f64>>>,
) -> ObjectBuilder<SetMultipleOf<S>>where
S::MultipleOf: IsUnset,
Optional (Some / Option setters).
The multipleOf
keyword ensures the number is a multiple of this value.
https://www.learnjsonschema.com/2020-12/validation/multipleOf/
Sourcepub fn maximum(
self,
value: impl Into<OrderedFloat<f64>>,
) -> ObjectBuilder<SetMaximum<S>>where
S::Maximum: IsUnset,
pub fn maximum(
self,
value: impl Into<OrderedFloat<f64>>,
) -> ObjectBuilder<SetMaximum<S>>where
S::Maximum: IsUnset,
Optional (Some / Option setters).
The maximum
keyword defines the maximum numeric value.
https://www.learnjsonschema.com/2020-12/validation/maximum/
Sourcepub fn maybe_maximum(
self,
value: Option<impl Into<OrderedFloat<f64>>>,
) -> ObjectBuilder<SetMaximum<S>>where
S::Maximum: IsUnset,
pub fn maybe_maximum(
self,
value: Option<impl Into<OrderedFloat<f64>>>,
) -> ObjectBuilder<SetMaximum<S>>where
S::Maximum: IsUnset,
Optional (Some / Option setters).
The maximum
keyword defines the maximum numeric value.
https://www.learnjsonschema.com/2020-12/validation/maximum/
Sourcepub fn exclusive_maximum(
self,
value: impl Into<OrderedFloat<f64>>,
) -> ObjectBuilder<SetExclusiveMaximum<S>>where
S::ExclusiveMaximum: IsUnset,
pub fn exclusive_maximum(
self,
value: impl Into<OrderedFloat<f64>>,
) -> ObjectBuilder<SetExclusiveMaximum<S>>where
S::ExclusiveMaximum: IsUnset,
Optional (Some / Option setters).
The exclusiveMaximum
keyword requires the number to be less than this value.
https://www.learnjsonschema.com/2020-12/validation/exclusiveMaximum/
Sourcepub fn maybe_exclusive_maximum(
self,
value: Option<impl Into<OrderedFloat<f64>>>,
) -> ObjectBuilder<SetExclusiveMaximum<S>>where
S::ExclusiveMaximum: IsUnset,
pub fn maybe_exclusive_maximum(
self,
value: Option<impl Into<OrderedFloat<f64>>>,
) -> ObjectBuilder<SetExclusiveMaximum<S>>where
S::ExclusiveMaximum: IsUnset,
Optional (Some / Option setters).
The exclusiveMaximum
keyword requires the number to be less than this value.
https://www.learnjsonschema.com/2020-12/validation/exclusiveMaximum/
Sourcepub fn minimum(
self,
value: impl Into<OrderedFloat<f64>>,
) -> ObjectBuilder<SetMinimum<S>>where
S::Minimum: IsUnset,
pub fn minimum(
self,
value: impl Into<OrderedFloat<f64>>,
) -> ObjectBuilder<SetMinimum<S>>where
S::Minimum: IsUnset,
Optional (Some / Option setters).
The minimum
keyword defines the minimum numeric value.
https://www.learnjsonschema.com/2020-12/validation/minimum/
Sourcepub fn maybe_minimum(
self,
value: Option<impl Into<OrderedFloat<f64>>>,
) -> ObjectBuilder<SetMinimum<S>>where
S::Minimum: IsUnset,
pub fn maybe_minimum(
self,
value: Option<impl Into<OrderedFloat<f64>>>,
) -> ObjectBuilder<SetMinimum<S>>where
S::Minimum: IsUnset,
Optional (Some / Option setters).
The minimum
keyword defines the minimum numeric value.
https://www.learnjsonschema.com/2020-12/validation/minimum/
Sourcepub fn exclusive_minimum(
self,
value: impl Into<OrderedFloat<f64>>,
) -> ObjectBuilder<SetExclusiveMinimum<S>>where
S::ExclusiveMinimum: IsUnset,
pub fn exclusive_minimum(
self,
value: impl Into<OrderedFloat<f64>>,
) -> ObjectBuilder<SetExclusiveMinimum<S>>where
S::ExclusiveMinimum: IsUnset,
Optional (Some / Option setters).
The exclusiveMinimum
keyword requires the number to be greater than this value.
https://www.learnjsonschema.com/2020-12/validation/exclusiveMinimum/
Sourcepub fn maybe_exclusive_minimum(
self,
value: Option<impl Into<OrderedFloat<f64>>>,
) -> ObjectBuilder<SetExclusiveMinimum<S>>where
S::ExclusiveMinimum: IsUnset,
pub fn maybe_exclusive_minimum(
self,
value: Option<impl Into<OrderedFloat<f64>>>,
) -> ObjectBuilder<SetExclusiveMinimum<S>>where
S::ExclusiveMinimum: IsUnset,
Optional (Some / Option setters).
The exclusiveMinimum
keyword requires the number to be greater than this value.
https://www.learnjsonschema.com/2020-12/validation/exclusiveMinimum/
Sourcepub fn max_length(self, value: impl Into<u64>) -> ObjectBuilder<SetMaxLength<S>>where
S::MaxLength: IsUnset,
pub fn max_length(self, value: impl Into<u64>) -> ObjectBuilder<SetMaxLength<S>>where
S::MaxLength: IsUnset,
Optional (Some / Option setters).
The maxLength
keyword restricts string length to at most this value.
https://www.learnjsonschema.com/2020-12/validation/maxLength/
Sourcepub fn maybe_max_length(
self,
value: Option<impl Into<u64>>,
) -> ObjectBuilder<SetMaxLength<S>>where
S::MaxLength: IsUnset,
pub fn maybe_max_length(
self,
value: Option<impl Into<u64>>,
) -> ObjectBuilder<SetMaxLength<S>>where
S::MaxLength: IsUnset,
Optional (Some / Option setters).
The maxLength
keyword restricts string length to at most this value.
https://www.learnjsonschema.com/2020-12/validation/maxLength/
Sourcepub fn min_length(self, value: impl Into<u64>) -> ObjectBuilder<SetMinLength<S>>where
S::MinLength: IsUnset,
pub fn min_length(self, value: impl Into<u64>) -> ObjectBuilder<SetMinLength<S>>where
S::MinLength: IsUnset,
Optional (Some / Option setters).
The minLength
keyword restricts string length to at least this value.
https://www.learnjsonschema.com/2020-12/validation/minLength/
Sourcepub fn maybe_min_length(
self,
value: Option<impl Into<u64>>,
) -> ObjectBuilder<SetMinLength<S>>where
S::MinLength: IsUnset,
pub fn maybe_min_length(
self,
value: Option<impl Into<u64>>,
) -> ObjectBuilder<SetMinLength<S>>where
S::MinLength: IsUnset,
Optional (Some / Option setters).
The minLength
keyword restricts string length to at least this value.
https://www.learnjsonschema.com/2020-12/validation/minLength/
Sourcepub fn pattern(self, value: impl Into<String>) -> ObjectBuilder<SetPattern<S>>where
S::Pattern: IsUnset,
pub fn pattern(self, value: impl Into<String>) -> ObjectBuilder<SetPattern<S>>where
S::Pattern: IsUnset,
Optional (Some / Option setters).
The pattern
keyword restricts strings to those matching this regular expression.
https://www.learnjsonschema.com/2020-12/validation/pattern/
Sourcepub fn maybe_pattern(
self,
value: Option<impl Into<String>>,
) -> ObjectBuilder<SetPattern<S>>where
S::Pattern: IsUnset,
pub fn maybe_pattern(
self,
value: Option<impl Into<String>>,
) -> ObjectBuilder<SetPattern<S>>where
S::Pattern: IsUnset,
Optional (Some / Option setters).
The pattern
keyword restricts strings to those matching this regular expression.
https://www.learnjsonschema.com/2020-12/validation/pattern/
Sourcepub fn additional_items(
self,
value: impl Into<Schema>,
) -> ObjectBuilder<SetAdditionalItems<S>>where
S::AdditionalItems: IsUnset,
pub fn additional_items(
self,
value: impl Into<Schema>,
) -> ObjectBuilder<SetAdditionalItems<S>>where
S::AdditionalItems: IsUnset,
Optional (Some / Option setters).
The additionalItems
keyword defines the schema for array elements beyond those covered by a tuple definition.
https://www.learnjsonschema.com/2020-12/applicator/additionalItems/
Sourcepub fn maybe_additional_items(
self,
value: Option<impl Into<Schema>>,
) -> ObjectBuilder<SetAdditionalItems<S>>where
S::AdditionalItems: IsUnset,
pub fn maybe_additional_items(
self,
value: Option<impl Into<Schema>>,
) -> ObjectBuilder<SetAdditionalItems<S>>where
S::AdditionalItems: IsUnset,
Optional (Some / Option setters).
The additionalItems
keyword defines the schema for array elements beyond those covered by a tuple definition.
https://www.learnjsonschema.com/2020-12/applicator/additionalItems/
Sourcepub fn items(self, value: impl Into<Schema>) -> ObjectBuilder<SetItems<S>>where
S::Items: IsUnset,
pub fn items(self, value: impl Into<Schema>) -> ObjectBuilder<SetItems<S>>where
S::Items: IsUnset,
Optional (Some / Option setters).
The items
keyword restricts all elements in an array to this schema, or provides a tuple of schemas for positional validation.
https://www.learnjsonschema.com/2020-12/applicator/items/
Sourcepub fn maybe_items(
self,
value: Option<impl Into<Schema>>,
) -> ObjectBuilder<SetItems<S>>where
S::Items: IsUnset,
pub fn maybe_items(
self,
value: Option<impl Into<Schema>>,
) -> ObjectBuilder<SetItems<S>>where
S::Items: IsUnset,
Optional (Some / Option setters).
The items
keyword restricts all elements in an array to this schema, or provides a tuple of schemas for positional validation.
https://www.learnjsonschema.com/2020-12/applicator/items/
Sourcepub fn max_items(self, value: impl Into<u64>) -> ObjectBuilder<SetMaxItems<S>>where
S::MaxItems: IsUnset,
pub fn max_items(self, value: impl Into<u64>) -> ObjectBuilder<SetMaxItems<S>>where
S::MaxItems: IsUnset,
Optional (Some / Option setters).
The maxItems
keyword restricts the number of elements in an array to at most this value.
https://www.learnjsonschema.com/2020-12/validation/maxItems/
Sourcepub fn maybe_max_items(
self,
value: Option<impl Into<u64>>,
) -> ObjectBuilder<SetMaxItems<S>>where
S::MaxItems: IsUnset,
pub fn maybe_max_items(
self,
value: Option<impl Into<u64>>,
) -> ObjectBuilder<SetMaxItems<S>>where
S::MaxItems: IsUnset,
Optional (Some / Option setters).
The maxItems
keyword restricts the number of elements in an array to at most this value.
https://www.learnjsonschema.com/2020-12/validation/maxItems/
Sourcepub fn min_items(self, value: impl Into<u64>) -> ObjectBuilder<SetMinItems<S>>where
S::MinItems: IsUnset,
pub fn min_items(self, value: impl Into<u64>) -> ObjectBuilder<SetMinItems<S>>where
S::MinItems: IsUnset,
Optional (Some / Option setters).
The minItems
keyword restricts the number of elements in an array to at least this value.
https://www.learnjsonschema.com/2020-12/validation/minItems/
Sourcepub fn maybe_min_items(
self,
value: Option<impl Into<u64>>,
) -> ObjectBuilder<SetMinItems<S>>where
S::MinItems: IsUnset,
pub fn maybe_min_items(
self,
value: Option<impl Into<u64>>,
) -> ObjectBuilder<SetMinItems<S>>where
S::MinItems: IsUnset,
Optional (Some / Option setters).
The minItems
keyword restricts the number of elements in an array to at least this value.
https://www.learnjsonschema.com/2020-12/validation/minItems/
Sourcepub fn unique_items(
self,
value: impl Into<bool>,
) -> ObjectBuilder<SetUniqueItems<S>>where
S::UniqueItems: IsUnset,
pub fn unique_items(
self,
value: impl Into<bool>,
) -> ObjectBuilder<SetUniqueItems<S>>where
S::UniqueItems: IsUnset,
Optional (Some / Option setters).
The uniqueItems
keyword ensures that all elements in an array are unique.
https://www.learnjsonschema.com/2020-12/validation/uniqueItems/
Sourcepub fn maybe_unique_items(
self,
value: Option<impl Into<bool>>,
) -> ObjectBuilder<SetUniqueItems<S>>where
S::UniqueItems: IsUnset,
pub fn maybe_unique_items(
self,
value: Option<impl Into<bool>>,
) -> ObjectBuilder<SetUniqueItems<S>>where
S::UniqueItems: IsUnset,
Optional (Some / Option setters).
The uniqueItems
keyword ensures that all elements in an array are unique.
https://www.learnjsonschema.com/2020-12/validation/uniqueItems/
Sourcepub fn contains(self, value: impl Into<Schema>) -> ObjectBuilder<SetContains<S>>where
S::Contains: IsUnset,
pub fn contains(self, value: impl Into<Schema>) -> ObjectBuilder<SetContains<S>>where
S::Contains: IsUnset,
Optional (Some / Option setters).
The contains
keyword ensures that at least one element in the array matches the specified schema.
https://www.learnjsonschema.com/2020-12/applicator/contains/
Sourcepub fn maybe_contains(
self,
value: Option<impl Into<Schema>>,
) -> ObjectBuilder<SetContains<S>>where
S::Contains: IsUnset,
pub fn maybe_contains(
self,
value: Option<impl Into<Schema>>,
) -> ObjectBuilder<SetContains<S>>where
S::Contains: IsUnset,
Optional (Some / Option setters).
The contains
keyword ensures that at least one element in the array matches the specified schema.
https://www.learnjsonschema.com/2020-12/applicator/contains/
Sourcepub fn max_properties(
self,
value: impl Into<u64>,
) -> ObjectBuilder<SetMaxProperties<S>>where
S::MaxProperties: IsUnset,
pub fn max_properties(
self,
value: impl Into<u64>,
) -> ObjectBuilder<SetMaxProperties<S>>where
S::MaxProperties: IsUnset,
Optional (Some / Option setters).
The maxProperties
keyword restricts the number of properties in an object to at most this value.
https://www.learnjsonschema.com/2020-12/validation/maxProperties/
Sourcepub fn maybe_max_properties(
self,
value: Option<impl Into<u64>>,
) -> ObjectBuilder<SetMaxProperties<S>>where
S::MaxProperties: IsUnset,
pub fn maybe_max_properties(
self,
value: Option<impl Into<u64>>,
) -> ObjectBuilder<SetMaxProperties<S>>where
S::MaxProperties: IsUnset,
Optional (Some / Option setters).
The maxProperties
keyword restricts the number of properties in an object to at most this value.
https://www.learnjsonschema.com/2020-12/validation/maxProperties/
Sourcepub fn min_properties(
self,
value: impl Into<u64>,
) -> ObjectBuilder<SetMinProperties<S>>where
S::MinProperties: IsUnset,
pub fn min_properties(
self,
value: impl Into<u64>,
) -> ObjectBuilder<SetMinProperties<S>>where
S::MinProperties: IsUnset,
Optional (Some / Option setters).
The minProperties
keyword restricts the number of properties in an object to at least this value.
https://www.learnjsonschema.com/2020-12/validation/minProperties/
Sourcepub fn maybe_min_properties(
self,
value: Option<impl Into<u64>>,
) -> ObjectBuilder<SetMinProperties<S>>where
S::MinProperties: IsUnset,
pub fn maybe_min_properties(
self,
value: Option<impl Into<u64>>,
) -> ObjectBuilder<SetMinProperties<S>>where
S::MinProperties: IsUnset,
Optional (Some / Option setters).
The minProperties
keyword restricts the number of properties in an object to at least this value.
https://www.learnjsonschema.com/2020-12/validation/minProperties/
Sourcepub fn max_contains(
self,
value: impl Into<u64>,
) -> ObjectBuilder<SetMaxContains<S>>where
S::MaxContains: IsUnset,
pub fn max_contains(
self,
value: impl Into<u64>,
) -> ObjectBuilder<SetMaxContains<S>>where
S::MaxContains: IsUnset,
Optional (Some / Option setters).
The maxContains
keyword limits how many items matching contains
may appear in an array.
https://www.learnjsonschema.com/2020-12/applicator/maxContains/
Sourcepub fn maybe_max_contains(
self,
value: Option<impl Into<u64>>,
) -> ObjectBuilder<SetMaxContains<S>>where
S::MaxContains: IsUnset,
pub fn maybe_max_contains(
self,
value: Option<impl Into<u64>>,
) -> ObjectBuilder<SetMaxContains<S>>where
S::MaxContains: IsUnset,
Optional (Some / Option setters).
The maxContains
keyword limits how many items matching contains
may appear in an array.
https://www.learnjsonschema.com/2020-12/applicator/maxContains/
Sourcepub fn min_contains(
self,
value: impl Into<u64>,
) -> ObjectBuilder<SetMinContains<S>>where
S::MinContains: IsUnset,
pub fn min_contains(
self,
value: impl Into<u64>,
) -> ObjectBuilder<SetMinContains<S>>where
S::MinContains: IsUnset,
Optional (Some / Option setters).
The minContains
keyword requires at least this many items matching contains
in an array.
https://www.learnjsonschema.com/2020-12/applicator/minContains/
Sourcepub fn maybe_min_contains(
self,
value: Option<impl Into<u64>>,
) -> ObjectBuilder<SetMinContains<S>>where
S::MinContains: IsUnset,
pub fn maybe_min_contains(
self,
value: Option<impl Into<u64>>,
) -> ObjectBuilder<SetMinContains<S>>where
S::MinContains: IsUnset,
Optional (Some / Option setters).
The minContains
keyword requires at least this many items matching contains
in an array.
https://www.learnjsonschema.com/2020-12/applicator/minContains/
Sourcepub fn additional_properties(
self,
value: impl Into<Schema>,
) -> ObjectBuilder<SetAdditionalProperties<S>>where
S::AdditionalProperties: IsUnset,
pub fn additional_properties(
self,
value: impl Into<Schema>,
) -> ObjectBuilder<SetAdditionalProperties<S>>where
S::AdditionalProperties: IsUnset,
Optional (Some / Option setters).
The additionalProperties
keyword defines the schema for object properties not explicitly listed.
https://www.learnjsonschema.com/2020-12/applicator/additionalProperties/
Sourcepub fn maybe_additional_properties(
self,
value: Option<impl Into<Schema>>,
) -> ObjectBuilder<SetAdditionalProperties<S>>where
S::AdditionalProperties: IsUnset,
pub fn maybe_additional_properties(
self,
value: Option<impl Into<Schema>>,
) -> ObjectBuilder<SetAdditionalProperties<S>>where
S::AdditionalProperties: IsUnset,
Optional (Some / Option setters).
The additionalProperties
keyword defines the schema for object properties not explicitly listed.
https://www.learnjsonschema.com/2020-12/applicator/additionalProperties/
Sourcepub fn definitions(
self,
value: impl Into<IndexMap<String, Schema>>,
) -> ObjectBuilder<SetDefinitions<S>>where
S::Definitions: IsUnset,
pub fn definitions(
self,
value: impl Into<IndexMap<String, Schema>>,
) -> ObjectBuilder<SetDefinitions<S>>where
S::Definitions: IsUnset,
Optional (Some / Option setters). Default: <IndexMap<String, Schema> as Default>::default()
.
The definitions
section holds reusable schema definitions for reference.
https://www.learnjsonschema.com/2020-12/meta-data/definitions/
Sourcepub fn maybe_definitions(
self,
value: Option<impl Into<IndexMap<String, Schema>>>,
) -> ObjectBuilder<SetDefinitions<S>>where
S::Definitions: IsUnset,
pub fn maybe_definitions(
self,
value: Option<impl Into<IndexMap<String, Schema>>>,
) -> ObjectBuilder<SetDefinitions<S>>where
S::Definitions: IsUnset,
Optional (Some / Option setters). Default: <IndexMap<String, Schema> as Default>::default()
.
The definitions
section holds reusable schema definitions for reference.
https://www.learnjsonschema.com/2020-12/meta-data/definitions/
Sourcepub fn pattern_properties(
self,
value: impl Into<IndexMap<String, Schema>>,
) -> ObjectBuilder<SetPatternProperties<S>>where
S::PatternProperties: IsUnset,
pub fn pattern_properties(
self,
value: impl Into<IndexMap<String, Schema>>,
) -> ObjectBuilder<SetPatternProperties<S>>where
S::PatternProperties: IsUnset,
Optional (Some / Option setters). Default: <IndexMap<String, Schema> as Default>::default()
.
The patternProperties
keyword maps regex patterns to schemas for matching property names.
https://www.learnjsonschema.com/2020-12/applicator/patternProperties/
Sourcepub fn maybe_pattern_properties(
self,
value: Option<impl Into<IndexMap<String, Schema>>>,
) -> ObjectBuilder<SetPatternProperties<S>>where
S::PatternProperties: IsUnset,
pub fn maybe_pattern_properties(
self,
value: Option<impl Into<IndexMap<String, Schema>>>,
) -> ObjectBuilder<SetPatternProperties<S>>where
S::PatternProperties: IsUnset,
Optional (Some / Option setters). Default: <IndexMap<String, Schema> as Default>::default()
.
The patternProperties
keyword maps regex patterns to schemas for matching property names.
https://www.learnjsonschema.com/2020-12/applicator/patternProperties/
Sourcepub fn dependencies(
self,
value: impl Into<IndexMap<String, Schema>>,
) -> ObjectBuilder<SetDependencies<S>>where
S::Dependencies: IsUnset,
pub fn dependencies(
self,
value: impl Into<IndexMap<String, Schema>>,
) -> ObjectBuilder<SetDependencies<S>>where
S::Dependencies: IsUnset,
Optional (Some / Option setters). Default: <IndexMap<String, Schema> as Default>::default()
.
The dependencies
keyword specifies schema or property dependencies for an object.
https://www.learnjsonschema.com/2020-12/applicator/dependencies/
Sourcepub fn maybe_dependencies(
self,
value: Option<impl Into<IndexMap<String, Schema>>>,
) -> ObjectBuilder<SetDependencies<S>>where
S::Dependencies: IsUnset,
pub fn maybe_dependencies(
self,
value: Option<impl Into<IndexMap<String, Schema>>>,
) -> ObjectBuilder<SetDependencies<S>>where
S::Dependencies: IsUnset,
Optional (Some / Option setters). Default: <IndexMap<String, Schema> as Default>::default()
.
The dependencies
keyword specifies schema or property dependencies for an object.
https://www.learnjsonschema.com/2020-12/applicator/dependencies/
Sourcepub fn property_names(
self,
value: impl Into<Schema>,
) -> ObjectBuilder<SetPropertyNames<S>>where
S::PropertyNames: IsUnset,
pub fn property_names(
self,
value: impl Into<Schema>,
) -> ObjectBuilder<SetPropertyNames<S>>where
S::PropertyNames: IsUnset,
Optional (Some / Option setters).
The propertyNames
keyword restricts all property names in an object to match this schema.
https://www.learnjsonschema.com/2020-12/applicator/propertyNames/
Sourcepub fn maybe_property_names(
self,
value: Option<impl Into<Schema>>,
) -> ObjectBuilder<SetPropertyNames<S>>where
S::PropertyNames: IsUnset,
pub fn maybe_property_names(
self,
value: Option<impl Into<Schema>>,
) -> ObjectBuilder<SetPropertyNames<S>>where
S::PropertyNames: IsUnset,
Optional (Some / Option setters).
The propertyNames
keyword restricts all property names in an object to match this schema.
https://www.learnjsonschema.com/2020-12/applicator/propertyNames/
Sourcepub fn const_value(
self,
value: impl Into<Value>,
) -> ObjectBuilder<SetConstValue<S>>where
S::ConstValue: IsUnset,
pub fn const_value(
self,
value: impl Into<Value>,
) -> ObjectBuilder<SetConstValue<S>>where
S::ConstValue: IsUnset,
Optional (Some / Option setters).
The const
keyword requires the instance to be exactly this value.
https://www.learnjsonschema.com/2020-12/validation/const/
Sourcepub fn maybe_const_value(
self,
value: Option<impl Into<Value>>,
) -> ObjectBuilder<SetConstValue<S>>where
S::ConstValue: IsUnset,
pub fn maybe_const_value(
self,
value: Option<impl Into<Value>>,
) -> ObjectBuilder<SetConstValue<S>>where
S::ConstValue: IsUnset,
Optional (Some / Option setters).
The const
keyword requires the instance to be exactly this value.
https://www.learnjsonschema.com/2020-12/validation/const/
Sourcepub fn schema_type(
self,
value: impl Into<Types>,
) -> ObjectBuilder<SetSchemaType<S>>where
S::SchemaType: IsUnset,
pub fn schema_type(
self,
value: impl Into<Types>,
) -> ObjectBuilder<SetSchemaType<S>>where
S::SchemaType: IsUnset,
Optional (Some / Option setters).
The type
keyword restricts the instance to the specified JSON types.
https://www.learnjsonschema.com/2020-12/validation/type/
Sourcepub fn maybe_schema_type(
self,
value: Option<impl Into<Types>>,
) -> ObjectBuilder<SetSchemaType<S>>where
S::SchemaType: IsUnset,
pub fn maybe_schema_type(
self,
value: Option<impl Into<Types>>,
) -> ObjectBuilder<SetSchemaType<S>>where
S::SchemaType: IsUnset,
Optional (Some / Option setters).
The type
keyword restricts the instance to the specified JSON types.
https://www.learnjsonschema.com/2020-12/validation/type/
Sourcepub fn format(self, value: impl Into<String>) -> ObjectBuilder<SetFormat<S>>where
S::Format: IsUnset,
pub fn format(self, value: impl Into<String>) -> ObjectBuilder<SetFormat<S>>where
S::Format: IsUnset,
Optional (Some / Option setters). Default: ""
.
The format
keyword provides semantic validation hints, such as “email” or “date-time”.
https://www.learnjsonschema.com/2020-12/meta-data/format/
Sourcepub fn maybe_format(
self,
value: Option<impl Into<String>>,
) -> ObjectBuilder<SetFormat<S>>where
S::Format: IsUnset,
pub fn maybe_format(
self,
value: Option<impl Into<String>>,
) -> ObjectBuilder<SetFormat<S>>where
S::Format: IsUnset,
Optional (Some / Option setters). Default: ""
.
The format
keyword provides semantic validation hints, such as “email” or “date-time”.
https://www.learnjsonschema.com/2020-12/meta-data/format/
Sourcepub fn content_media_type(
self,
value: impl Into<String>,
) -> ObjectBuilder<SetContentMediaType<S>>where
S::ContentMediaType: IsUnset,
pub fn content_media_type(
self,
value: impl Into<String>,
) -> ObjectBuilder<SetContentMediaType<S>>where
S::ContentMediaType: IsUnset,
Optional (Some / Option setters). Default: ""
.
The contentMediaType
annotation describes the media type for string content.
https://www.learnjsonschema.com/2020-12/annotations/contentMediaType/
Sourcepub fn maybe_content_media_type(
self,
value: Option<impl Into<String>>,
) -> ObjectBuilder<SetContentMediaType<S>>where
S::ContentMediaType: IsUnset,
pub fn maybe_content_media_type(
self,
value: Option<impl Into<String>>,
) -> ObjectBuilder<SetContentMediaType<S>>where
S::ContentMediaType: IsUnset,
Optional (Some / Option setters). Default: ""
.
The contentMediaType
annotation describes the media type for string content.
https://www.learnjsonschema.com/2020-12/annotations/contentMediaType/
Sourcepub fn content_encoding(
self,
value: impl Into<String>,
) -> ObjectBuilder<SetContentEncoding<S>>where
S::ContentEncoding: IsUnset,
pub fn content_encoding(
self,
value: impl Into<String>,
) -> ObjectBuilder<SetContentEncoding<S>>where
S::ContentEncoding: IsUnset,
Optional (Some / Option setters). Default: ""
.
The contentEncoding
annotation describes the encoding (e.g., “base64”) for string content.
https://www.learnjsonschema.com/2020-12/annotations/contentEncoding/
Sourcepub fn maybe_content_encoding(
self,
value: Option<impl Into<String>>,
) -> ObjectBuilder<SetContentEncoding<S>>where
S::ContentEncoding: IsUnset,
pub fn maybe_content_encoding(
self,
value: Option<impl Into<String>>,
) -> ObjectBuilder<SetContentEncoding<S>>where
S::ContentEncoding: IsUnset,
Optional (Some / Option setters). Default: ""
.
The contentEncoding
annotation describes the encoding (e.g., “base64”) for string content.
https://www.learnjsonschema.com/2020-12/annotations/contentEncoding/
Sourcepub fn content_schema(
self,
value: impl Into<Schema>,
) -> ObjectBuilder<SetContentSchema<S>>where
S::ContentSchema: IsUnset,
pub fn content_schema(
self,
value: impl Into<Schema>,
) -> ObjectBuilder<SetContentSchema<S>>where
S::ContentSchema: IsUnset,
Optional (Some / Option setters).
The contentSchema
annotation defines a schema for binary media represented as a string.
https://www.learnjsonschema.com/2020-12/applicator/contentSchema/
Sourcepub fn maybe_content_schema(
self,
value: Option<impl Into<Schema>>,
) -> ObjectBuilder<SetContentSchema<S>>where
S::ContentSchema: IsUnset,
pub fn maybe_content_schema(
self,
value: Option<impl Into<Schema>>,
) -> ObjectBuilder<SetContentSchema<S>>where
S::ContentSchema: IsUnset,
Optional (Some / Option setters).
The contentSchema
annotation defines a schema for binary media represented as a string.
https://www.learnjsonschema.com/2020-12/applicator/contentSchema/
Sourcepub fn if_cond(self, value: impl Into<Schema>) -> ObjectBuilder<SetIfCond<S>>where
S::IfCond: IsUnset,
pub fn if_cond(self, value: impl Into<Schema>) -> ObjectBuilder<SetIfCond<S>>where
S::IfCond: IsUnset,
Optional (Some / Option setters).
The if
keyword applies conditional schema validation when this subschema is valid.
https://www.learnjsonschema.com/2020-12/applicator/if/
Sourcepub fn maybe_if_cond(
self,
value: Option<impl Into<Schema>>,
) -> ObjectBuilder<SetIfCond<S>>where
S::IfCond: IsUnset,
pub fn maybe_if_cond(
self,
value: Option<impl Into<Schema>>,
) -> ObjectBuilder<SetIfCond<S>>where
S::IfCond: IsUnset,
Optional (Some / Option setters).
The if
keyword applies conditional schema validation when this subschema is valid.
https://www.learnjsonschema.com/2020-12/applicator/if/
Sourcepub fn then_cond(
self,
value: impl Into<Schema>,
) -> ObjectBuilder<SetThenCond<S>>where
S::ThenCond: IsUnset,
pub fn then_cond(
self,
value: impl Into<Schema>,
) -> ObjectBuilder<SetThenCond<S>>where
S::ThenCond: IsUnset,
Optional (Some / Option setters).
The then
keyword applies this subschema when the if
condition is met.
https://www.learnjsonschema.com/2020-12/applicator/then/
Sourcepub fn maybe_then_cond(
self,
value: Option<impl Into<Schema>>,
) -> ObjectBuilder<SetThenCond<S>>where
S::ThenCond: IsUnset,
pub fn maybe_then_cond(
self,
value: Option<impl Into<Schema>>,
) -> ObjectBuilder<SetThenCond<S>>where
S::ThenCond: IsUnset,
Optional (Some / Option setters).
The then
keyword applies this subschema when the if
condition is met.
https://www.learnjsonschema.com/2020-12/applicator/then/
Sourcepub fn else_cond(
self,
value: impl Into<Schema>,
) -> ObjectBuilder<SetElseCond<S>>where
S::ElseCond: IsUnset,
pub fn else_cond(
self,
value: impl Into<Schema>,
) -> ObjectBuilder<SetElseCond<S>>where
S::ElseCond: IsUnset,
Optional (Some / Option setters).
The else
keyword applies this subschema when the if
condition is not met.
https://www.learnjsonschema.com/2020-12/applicator/else/
Sourcepub fn maybe_else_cond(
self,
value: Option<impl Into<Schema>>,
) -> ObjectBuilder<SetElseCond<S>>where
S::ElseCond: IsUnset,
pub fn maybe_else_cond(
self,
value: Option<impl Into<Schema>>,
) -> ObjectBuilder<SetElseCond<S>>where
S::ElseCond: IsUnset,
Optional (Some / Option setters).
The else
keyword applies this subschema when the if
condition is not met.
https://www.learnjsonschema.com/2020-12/applicator/else/
Sourcepub fn not(self, value: impl Into<Schema>) -> ObjectBuilder<SetNot<S>>where
S::Not: IsUnset,
pub fn not(self, value: impl Into<Schema>) -> ObjectBuilder<SetNot<S>>where
S::Not: IsUnset,
Optional (Some / Option setters).
The not
keyword ensures the instance does not match this subschema.
https://www.learnjsonschema.com/2020-12/applicator/not/
Sourcepub fn maybe_not(
self,
value: Option<impl Into<Schema>>,
) -> ObjectBuilder<SetNot<S>>where
S::Not: IsUnset,
pub fn maybe_not(
self,
value: Option<impl Into<Schema>>,
) -> ObjectBuilder<SetNot<S>>where
S::Not: IsUnset,
Optional (Some / Option setters).
The not
keyword ensures the instance does not match this subschema.
https://www.learnjsonschema.com/2020-12/applicator/not/
Sourcepub fn unevaluated_items(
self,
value: impl Into<Schema>,
) -> ObjectBuilder<SetUnevaluatedItems<S>>where
S::UnevaluatedItems: IsUnset,
pub fn unevaluated_items(
self,
value: impl Into<Schema>,
) -> ObjectBuilder<SetUnevaluatedItems<S>>where
S::UnevaluatedItems: IsUnset,
Optional (Some / Option setters).
The unevaluatedItems
keyword applies schemas to items not covered by items
or contains
.
https://www.learnjsonschema.com/2020-12/applicator/unevaluatedItems/
Sourcepub fn maybe_unevaluated_items(
self,
value: Option<impl Into<Schema>>,
) -> ObjectBuilder<SetUnevaluatedItems<S>>where
S::UnevaluatedItems: IsUnset,
pub fn maybe_unevaluated_items(
self,
value: Option<impl Into<Schema>>,
) -> ObjectBuilder<SetUnevaluatedItems<S>>where
S::UnevaluatedItems: IsUnset,
Optional (Some / Option setters).
The unevaluatedItems
keyword applies schemas to items not covered by items
or contains
.
https://www.learnjsonschema.com/2020-12/applicator/unevaluatedItems/
Sourcepub fn unevaluated_properties(
self,
value: impl Into<Schema>,
) -> ObjectBuilder<SetUnevaluatedProperties<S>>where
S::UnevaluatedProperties: IsUnset,
pub fn unevaluated_properties(
self,
value: impl Into<Schema>,
) -> ObjectBuilder<SetUnevaluatedProperties<S>>where
S::UnevaluatedProperties: IsUnset,
Optional (Some / Option setters).
The unevaluatedProperties
keyword applies schemas to properties not covered by properties
or pattern-based keywords.
https://www.learnjsonschema.com/2020-12/applicator/unevaluatedProperties/
Sourcepub fn maybe_unevaluated_properties(
self,
value: Option<impl Into<Schema>>,
) -> ObjectBuilder<SetUnevaluatedProperties<S>>where
S::UnevaluatedProperties: IsUnset,
pub fn maybe_unevaluated_properties(
self,
value: Option<impl Into<Schema>>,
) -> ObjectBuilder<SetUnevaluatedProperties<S>>where
S::UnevaluatedProperties: IsUnset,
Optional (Some / Option setters).
The unevaluatedProperties
keyword applies schemas to properties not covered by properties
or pattern-based keywords.
https://www.learnjsonschema.com/2020-12/applicator/unevaluatedProperties/
Sourcepub fn discriminator(
self,
value: impl Into<Discriminator>,
) -> ObjectBuilder<SetDiscriminator<S>>where
S::Discriminator: IsUnset,
pub fn discriminator(
self,
value: impl Into<Discriminator>,
) -> ObjectBuilder<SetDiscriminator<S>>where
S::Discriminator: IsUnset,
Optional (Some / Option setters).
The discriminator
keyword provides object property-based type differentiation (OpenAPI).
https://spec.openapis.org/oas/v3.1.0#discriminator-object
Sourcepub fn maybe_discriminator(
self,
value: Option<impl Into<Discriminator>>,
) -> ObjectBuilder<SetDiscriminator<S>>where
S::Discriminator: IsUnset,
pub fn maybe_discriminator(
self,
value: Option<impl Into<Discriminator>>,
) -> ObjectBuilder<SetDiscriminator<S>>where
S::Discriminator: IsUnset,
Optional (Some / Option setters).
The discriminator
keyword provides object property-based type differentiation (OpenAPI).
https://spec.openapis.org/oas/v3.1.0#discriminator-object
Sourcepub fn extensions(
self,
value: impl Into<Extensions>,
) -> ObjectBuilder<SetExtensions<S>>where
S::Extensions: IsUnset,
pub fn extensions(
self,
value: impl Into<Extensions>,
) -> ObjectBuilder<SetExtensions<S>>where
S::Extensions: IsUnset,
Sourcepub fn maybe_extensions(
self,
value: Option<impl Into<Extensions>>,
) -> ObjectBuilder<SetExtensions<S>>where
S::Extensions: IsUnset,
pub fn maybe_extensions(
self,
value: Option<impl Into<Extensions>>,
) -> ObjectBuilder<SetExtensions<S>>where
S::Extensions: IsUnset,
Source§impl<S: State> ObjectBuilder<S>
impl<S: State> ObjectBuilder<S>
Sourcepub fn properties<P: Into<String>, C: Into<Schema>>(
self,
properties: impl IntoIterator<Item = (P, C)>,
) -> Self
pub fn properties<P: Into<String>, C: Into<Schema>>( self, properties: impl IntoIterator<Item = (P, C)>, ) -> Self
Extend the properties using the iterator of (name, schema)
Sourcepub fn property(
self,
name: impl Into<String>,
schema: impl Into<Schema>,
) -> Self
pub fn property( self, name: impl Into<String>, schema: impl Into<Schema>, ) -> Self
Add a singular property
Sourcepub fn all_of(self, all_of: impl Into<Schema>) -> Self
pub fn all_of(self, all_of: impl Into<Schema>) -> Self
Add a singular schema into the allOf
array
Sourcepub fn all_ofs<C: Into<Schema>>(
self,
all_ofs: impl IntoIterator<Item = C>,
) -> Self
pub fn all_ofs<C: Into<Schema>>( self, all_ofs: impl IntoIterator<Item = C>, ) -> Self
Extend the allOf
array using the iterator of schemas
Sourcepub fn any_ofs<C: Into<Schema>>(
self,
any_ofs: impl IntoIterator<Item = C>,
) -> Self
pub fn any_ofs<C: Into<Schema>>( self, any_ofs: impl IntoIterator<Item = C>, ) -> Self
Extend the anyOf
array using the iterator of schemas
Sourcepub fn any_of(self, any_of: impl Into<Schema>) -> Self
pub fn any_of(self, any_of: impl Into<Schema>) -> Self
Add a singular schema into the anyOf
array
Sourcepub fn one_ofs<C: Into<Schema>>(
self,
one_ofs: impl IntoIterator<Item = C>,
) -> Self
pub fn one_ofs<C: Into<Schema>>( self, one_ofs: impl IntoIterator<Item = C>, ) -> Self
Extend the oneOfs
array using the iterator of schemas
Sourcepub fn one_of(self, one_of: impl Into<Schema>) -> Self
pub fn one_of(self, one_of: impl Into<Schema>) -> Self
Add a singular schema into the oneOf
array
Sourcepub fn enum_value(self, enum_value: impl Into<Value>) -> Self
pub fn enum_value(self, enum_value: impl Into<Value>) -> Self
Add a singular item into the enum
array
Sourcepub fn enum_values<E: Into<Value>>(
self,
enum_values: impl IntoIterator<Item = E>,
) -> Self
pub fn enum_values<E: Into<Value>>( self, enum_values: impl IntoIterator<Item = E>, ) -> Self
Extend the enum
array using an iterator of items
Sourcepub fn require(self, require: impl Into<String>) -> Self
pub fn require(self, require: impl Into<String>) -> Self
Add a single field into the required
array
Sourcepub fn required<R: Into<String>>(
self,
required: impl IntoIterator<Item = R>,
) -> Self
pub fn required<R: Into<String>>( self, required: impl IntoIterator<Item = R>, ) -> Self
Extend the required
array from the iterator of fields.
Sourcepub fn example(self, example: impl Into<Value>) -> Self
pub fn example(self, example: impl Into<Value>) -> Self
Add a single example to the examples
array
Sourcepub fn examples<E: Into<Value>>(
self,
examples: impl IntoIterator<Item = E>,
) -> Self
pub fn examples<E: Into<Value>>( self, examples: impl IntoIterator<Item = E>, ) -> Self
Extend the examples
array using an iterator of examples.
Source§impl<S: IsComplete> ObjectBuilder<S>
impl<S: IsComplete> ObjectBuilder<S>
Sourcepub fn to_array(self) -> ObjectBuilder<SetItems<SetSchemaType>>
pub fn to_array(self) -> ObjectBuilder<SetItems<SetSchemaType>>
Convert the object into an array of this type