Closed ghost closed 2 years ago
@narakhan Does the proposed change look OK to you? If so can you update your MR?
Hi all,
I had this problem with nested Union, and tried applying both changes above, but was still have the schema only produce the first listed cliass in a Union.
I did some more testing on my side, and it could be an issue where my Union was also Optional, ie I was using
# A, B defined already
a: Optional[Union[A,B]] = None
In the case above, only A would be defined in the schema. If I removed the Optional typing, and default of None, and so had instead the definition below (as matches the test.py test), then both definitions A and B would be included in the schema:
a: Union[A,B]
@richard-moss I have the same problem, see #147. I think it is another issue, not addressed by this PR.
Fixes issue #118