Since you are trying to parse config, you might also consider using pydantic-settings module instead of just pydantic. However, if all of your configuration is coming from YAML, this doesn't make a lot of sense.