noether.core.schemas.mixins¶
Classes¶
Marker class to indicate a field should inherit shared values from the parent config. |
|
Mixin to propagate shared fields from parent configuration to sub-configurations. |
Module Contents¶
Marker class to indicate a field should inherit shared values from the parent config.
Bases:
pydantic.BaseModelMixin to propagate shared fields from parent configuration to sub-configurations.
Supports recursive/nested injection across multiple levels of configuration hierarchy.
- Usage:
- class MyConfig(BaseModel, InjectSharedFieldFromParentMixin):
sub_config: Annotated[SubConfigType, Shared]
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- Parameters:
data (Any)
Propagates shared fields from parent config to sub-configurations recursively.
- Parameters:
data (Any)
- Return type:
Any