Class Field Defaults
The configuration system supports parsing the field defaults from dataclasses and Pydantic models.
Extract the field defaults of a dataclass or Pydantic model into a DictConfig with ConfigFieldParser. The result is a plain config that can be added as a defaults layer:
field_defaults = ConfigFieldParser.parse(MySettings, key="setting")
config.add_defaults(field_defaults)This allows programmatic defaults to be merged into the configuration system so they can be referenced and/or overridden.