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
| Attribute | Type | Description |
|---|---|---|
| type | Literal['include-exclude-dict'] | Fixed identifier used to specify the serialization schema type as 'include-exclude-dict'. |
| include | IncExDict | A dictionary mapping defining the specific fields or keys to be included during the serialization process. |
| exclude | IncExDict | A 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
| Type | Description |
|---|---|
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
| Type | Description |
|---|---|
IncExDict | A 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
| Type | Description |
|---|---|
IncExDict | A dictionary mapping of fields to be excluded. |