Skip to main content

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

AttributeTypeDescription
typeLiteral['any']Fixed literal value 'any' used to identify this schema type during validation and serialization.
refstrA unique string identifier used for referencing this schema in recursive or shared data structures.
metadatadict[str, Any]A dictionary of additional configuration data and custom properties used to extend the schema's behavior.
serializationSerSchemaConfiguration 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

NameTypeDescription
typeLiteral['any']The schema type identifier, which must be the literal string 'any'.
refstrAn optional reference string for the schema.
metadatadict[str, Any]A dictionary containing metadata associated with the schema.
serializationSerSchemaThe serialization schema configuration.

Methods


type()

def type() - > Literal['any']

Specifies the schema type identifier.

Returns

TypeDescription
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

TypeDescription
strA 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

TypeDescription
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

TypeDescription
SerSchemaA SerSchema object defining how data conforming to this schema should be transformed into a serializable format