Skip to main content

IncExDictSerSchema

This class defines a schema for specifying inclusion and exclusion rules for dictionary serialization. It provides a structured format to control which fields are processed or omitted during data operations using the include and exclude attributes.

Attributes

AttributeTypeDescription
typeLiteral['include-exclude-dict']Fixed identifier used to specify the serialization schema type as 'include-exclude-dict'.
includeIncExDictA dictionary mapping defining the specific fields or keys to be included during the serialization process.
excludeIncExDictA dictionary mapping defining the specific fields or keys to be omitted during the serialization process.

Methods


type()

def type() - > Literal['include-exclude-dict']

Specifies the schema type identifier, which must be set to 'include-exclude-dict' for this dictionary serialization schema.

Returns

TypeDescription
Literal['include-exclude-dict']The literal string identifier for the schema type.

include()

def include() - > IncExDict

Defines the specific fields or keys to be included during the serialization process.

Returns

TypeDescription
IncExDictA dictionary mapping of fields to be included.

exclude()

def exclude() - > IncExDict

Defines the specific fields or keys to be omitted or ignored during the serialization process.

Returns

TypeDescription
IncExDictA dictionary mapping of fields to be excluded.