New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Union discriminator does not work with enums of vec #755
Comments
The members in the enumeration must be an |
sunli829
added a commit
that referenced
this issue
Mar 24, 2024
…bject`, an error will be reported at compile time. #755
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Actual Behavior
Given this enum
Serialising with both serde and poem
This is good and dandy, poem does not support externally tagged enums, but the
"type": "..."
acts as the discriminator.Now if the enum is changed to the following:
Then serialised like this
it prints:
As can be seen, with
serde
the externally discrimination of the enums, makes it possible to differentiate between the two enums, but with poem, both prints[{\"path\":\"age\",\"value\":20}]
.Expected Behavior
poem should not serialise both of the enum variants into the same json string representation.
Because of this, it is also impossible to deserialise into the rust enums.
Specifications
poem = { version = "2.0.0" }
poem-openapi = { version = "4.0.0", features = ["swagger-ui", "uuid"] }
~ uname -a
Darwin DeeMBP2773 23.2.0 Darwin Kernel Version 23.2.0: Wed Nov 15 21:53:18 PST 2023; root:xnu-10002.61.3~2/RELEASE_ARM64_T6000 arm64
The text was updated successfully, but these errors were encountered: