You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Generation of list/array of discriminated union annotates the list, not the union. Same problem with = Field(..., discriminator) too if you don't use annotated.
Describe the bug
Generation of list/array of discriminated union annotates the list, not the union. Same problem with
= Field(..., discriminator)
too if you don't use annotated.To Reproduce
Example schema:
Used commandline:
This gives:
This doesn't work:
Expected behavior
The problem is that the Annotation should be on the Union, not on the list, so the SomeTest class should be:
And now it works. Note that we get more or less the same problem if you remove
--use-annotated
Version:
Additional context
Thanks!
The text was updated successfully, but these errors were encountered: