Skip to content
Discussion options

You must be logged in to vote

This was indeed caused by the changes in #4871. Apologies for the inconvenience.

The quick solution to this problem is to replace

Item = Annotated[
    ItemV1 | ItemV2,
    Field(discriminator='version'),
]

with

Item = Annotated[
    ItemV1 | ItemV2,
    Body(discriminator='version'),
]

I'm not really sure whether the original code was supposed to work before, or if it just worked incidentally.

@tiangolo what do you think? If you think it should work, I can try and figure out how to make it work.

Replies: 7 comments 9 replies

Comment options

You must be logged in to vote
1 reply
@phillipuniverse
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
7 replies
@nzig
Comment options

@karolpawlowski
Comment options

@stdkoehler
Comment options

@fortzi
Comment options

@nzig
Comment options

Answer selected by morian
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@morian
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Question or problem