-
-
Notifications
You must be signed in to change notification settings - Fork 66
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add RootSettings
#200
Comments
Thanks @rijenkii for reporting this. Yeah, it is not possible in class Settings(pydantic.BaseSettings):
__root__: Clustered | NonClustered Have you tried it in v1? |
You are right, it is not possible. I thought I've tried that, but it seems I've messed up somewhere. |
@hramezani
Now fails when |
@pavelrib |
@hramezani
But what's the next step to evaluate Settings? All examples show validation with an actual object, but here the values should be implicitly read from env. |
@hramezani Is there anything that I'm missing here? |
No, I think |
@hramezani Is there any plan to add it in the near future? I've tried playing with different definitions and parsing methods to no avail. |
@pavelrib I don't think that I can add it shortly. I hope some contributors work on this but this can be a complex feature |
After making a discussion, question, and not getting any answers, I assume the functionality I'm looking for is not implemented, so I am making a feature request.
I want to use a following model for my settings:
In pydantic v1 it was possible to do such a thing (I think)EDIT: Nope it wasn't
But in v2
__root__
was removed, and multiple inheritance does not work:What I assume needs to happen is
RootSettings
has to be added, so the following code can be written:The text was updated successfully, but these errors were encountered: