🚧 Sprout is still in active development and evolving quickly, so the documentation and functionality may not work as described and could undergo substantial changes 🚧
ConstraintsProperties
core.ConstraintsProperties(self,
bool | None = None,
required: bool | None = None,
unique: str | None = None,
pattern: list | None = None,
enum: int | None = None,
min_length: int | None = None,
max_length: str | float | int | None = None,
minimum: str | float | int | None = None,
maximum: str | float | int | None = None,
exclusive_minimum: str | float | int | None = None,
exclusive_maximum: dict[str, Any] | None = None,
json_schema: )
A class that expresses constraints for validating field values.
Attributes
required : bool | None
-
Indicates whether a property must have a value for each instance.
unique : bool | None
-
When
true
, each value for the property must be unique. pattern : str | None
-
A regular expression pattern to test each value of the property against, where a truthy response indicates validity.
enum : list | None
-
The value of the field must exactly match one of the values in the
enum
array. min_length : int | None
-
An integer that specifies the minimum length of a value.
max_length : int | None
-
An integer that specifies the maximum length of a value.
minimum : str | float | int | None
-
Specifies a minimum value for a field.
maximum : str | float | int | None
-
Specifies a maximum value for a field.
exclusive_minimum : str | float | int | None
-
Specifies an exclusive minimum value for a field.
exclusive_maximum : str | float | int | None
-
Specifies an exclusive maximum value for a field.
json_schema : dict[str, Any] | None
-
A valid JSON schema object to validate field values. If a field value conforms to the provided JSON schema then this field value is valid.
Methods
Name | Description |
---|---|
default | Creates an instance with default values. |
default
core.ConstraintsProperties.default()
Creates an instance with default values.
Returns
: Self
-
A ConstraintsProperties object with default values