Skip to main content

ExtraBehavior

This enum defines the strategies for handling additional or unexpected fields during data processing. It provides options to allow, forbid, or ignore extra behavior to ensure strictness or flexibility in data validation.

Attributes

AttributeTypeDescription
Allowenum memberPermits additional fields or behaviors that are not explicitly defined in the schema.
Forbidenum memberTriggers a validation error if any undefined fields or behaviors are encountered.
Ignoreenum memberSilently drops any undefined fields or behaviors without raising an error.

Methods


Allow()

def Allow() - > [ExtraBehavior](extrabehavior.md?sid=build_tools_extrabehavior)

Specifies that extra fields should be permitted and included in the processed data.

Returns

TypeDescription
[ExtraBehavior](extrabehavior.md?sid=build_tools_extrabehavior)The Allow variant of the ExtraBehavior enum.

Forbid()

def Forbid() - > [ExtraBehavior](extrabehavior.md?sid=build_tools_extrabehavior)

Specifies that the presence of extra fields should result in a validation error.

Returns

TypeDescription
[ExtraBehavior](extrabehavior.md?sid=build_tools_extrabehavior)The Forbid variant of the ExtraBehavior enum.

Ignore()

def Ignore() - > [ExtraBehavior](extrabehavior.md?sid=build_tools_extrabehavior)

Specifies that extra fields should be silently dropped during processing without raising an error.

Returns

TypeDescription
[ExtraBehavior](extrabehavior.md?sid=build_tools_extrabehavior)The Ignore variant of the ExtraBehavior enum.