-
I want to use a following model for my settings: class Clustered(pydantic.BaseModel):
is_clustered: typing.Literal[True]
server_name: str
class NonClustered(pydantic.BaseModel):
is_clustered: typing.Literal[False] = False
Settings = pydantic.RootModel[Clustered | NonClustered] How can I do so? I haven't managed to find anything like my use case. |
Beta Was this translation helpful? Give feedback.
Answered by
rijenkii
Dec 7, 2023
Replies: 1 comment
-
This is not possible yet, follow pydantic/pydantic-settings#200 for updates. |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
rijenkii
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is not possible yet, follow pydantic/pydantic-settings#200 for updates.