AnySchema
This class represents a schema definition that matches any data type within a validation or serialization framework. It defines a structure for handling generic references and associated metadata while supporting custom serialization configurations.
Attributes
| Attribute | Type | Description |
|---|---|---|
| type | Literal['any'] | Fixed literal value 'any' used to identify this schema type during validation and serialization. |
| ref | str | A unique string identifier used for referencing this schema in recursive or shared data structures. |
| metadata | dict[str, Any] | A dictionary of additional configuration data and custom properties used to extend the schema's behavior. |
| serialization | SerSchema | Configuration settings that define how the data should be transformed into a serialized format. |
Constructor
Signature
def AnySchema(
type: Literal['any'],
ref: str,
metadata: dict[str, Any],
serialization: SerSchema
) - > None
Parameters
| Name | Type | Description |
|---|---|---|
| type | Literal['any'] | The schema type identifier, which must be the literal string 'any'. |
| ref | str | An optional reference string for the schema. |
| metadata | dict[str, Any] | A dictionary containing metadata associated with the schema. |
| serialization | SerSchema | The serialization schema configuration. |
Methods
type()
def type() - > Literal['any']
Specifies the schema type identifier.
Returns
| Type | Description |
|---|---|
Literal['any'] | The literal string 'any' used to identify this schema type during validation or serialization |
ref()
def ref() - > str
Defines an optional reference string for the schema.
Returns
| Type | Description |
|---|---|
str | A unique identifier or URI used to reference this schema definition elsewhere |
metadata()
def metadata() - > dict[str, Any]
Stores a dictionary of arbitrary metadata associated with the schema.
Returns
| Type | Description |
|---|---|
dict[str, Any] | A mapping of string keys to any values, typically used for custom extensions or documentation purposes |
serialization()
def serialization() - > SerSchema
Configures the serialization behavior for this schema.
Returns
| Type | Description |
|---|---|
SerSchema | A SerSchema object defining how data conforming to this schema should be transformed into a serializable format |