Replies: 1 comment 1 reply
-
So, my understanding is that this should be possible with |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I have a json schema like this
This generates a Pydantic V2 model like this (or something like this)
But what I want is that
y
is a tuple, where the first element is of typeB
and the second element can beC
orD
. So, I want thisIn other words, the first element should always be a
B
, while the second can be aC
orD
. In reality, I don't really care if this is a tuple, it could also be a list, as long as the type constraints of the elements I've just described is satisfied.I don't know if this is a JSON schema limitation or not.
I thought of overriding the template, but maybe there's an easier solution just by changing my schema to specify that?
Also, I don't really know right now how I'd need to override the template.
Beta Was this translation helpful? Give feedback.
All reactions