Context Extra Options#
Additionally, Context
provides you with some extra capabilities for working with containing objects.
Default Values#
For instance, if you attempt to access a field that doesn't exist in the global context, you will receive a pydantic.ValidationError
exception.
However, you can set default values if needed.
Cast Context Types#
By default, context fields are NOT CAST to the type specified in their annotation.
If you require this functionality, you can enable the appropriate flag.
Last update:
2023-09-21