Skip to content
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

Prohibited use of elements other than JsonObject in JsonTransformingSerializer with polymorphic serialization #2715

Merged
merged 3 commits into from
Jun 24, 2024

Conversation

shanshin
Copy link
Contributor

If JsonTransformingSerializer is used as a serializer for the descendant of a polymorphic class, then we do not know how to add a type discriminator to the returned result of a primitive or array type.

Since there is no general solution to this problem on the library side, the user must take care of the correct processing of such types and, possibly, manually implement polymorphism.

Resolves #2164

…erializer with polymorphic serialization

If JsonTransformingSerializer is used as a serializer for the descendant of a polymorphic class, then we do not know how to add a type discriminator to the returned result of a primitive or array type.

Since there is no general solution to this problem on the library side, the user must take care of the correct processing of such types and, possibly, manually implement polymorphism.

Resolves #2164
@shanshin shanshin requested a review from sandwwraith June 12, 2024 16:02
shanshin and others added 2 commits June 14, 2024 22:39
…l/Polymorphic.kt

Co-authored-by: Leonid Startsev <sandwwraith@users.noreply.github.com>
@shanshin shanshin requested a review from sandwwraith June 14, 2024 20:58
@shanshin shanshin merged commit c628e29 into dev Jun 24, 2024
4 checks passed
@shanshin shanshin deleted the poly-element branch June 24, 2024 14:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants