-
Notifications
You must be signed in to change notification settings - Fork 622
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
Mismatch in deserialized/serialized serial name used for sealed value class. #2288
Labels
Comments
@sandwwraith any updates on this issue? |
tadfisher
added a commit
to tadfisher/kotlinx.serialization
that referenced
this issue
Mar 14, 2024
tadfisher
added a commit
to tadfisher/kotlinx.serialization
that referenced
this issue
Mar 14, 2024
tadfisher
added a commit
to tadfisher/kotlinx.serialization
that referenced
this issue
Mar 21, 2024
tadfisher
added a commit
to tadfisher/kotlinx.serialization
that referenced
this issue
Mar 21, 2024
orual
added a commit
to morpho-app/butterfly
that referenced
this issue
Sep 21, 2024
…alizer workaround is no longer needed and we can delete it and A LOT of boilerplate code.
orual
added a commit
to morpho-app/Morpho
that referenced
this issue
Sep 21, 2024
…alizer workaround is no longer needed and we can delete it and A LOT of boilerplate code.
orual
added a commit
to morpho-app/Morpho
that referenced
this issue
Sep 21, 2024
…alizer workaround is no longer needed and we can delete it and A LOT of boilerplate code.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
When serializing a sealed value class, the serial name of the inner class is embedded into the resulting JSON string. However, the produced string cannot be deserialized, as it is the outer class's serial name (ie: the sealed value class itself) that should be used here.
To Reproduce
Expected behavior
Json.encodeToString(sealed)
should probably return{"type":"outer","n":10}
instead, since that string would be able to be deserialized back into an equivalent instance as the original.I used
@SerialName
annotations to make the example more succinct, but the same issue can be seen if using omitting that and using the fully-qualified class names by default instead.Environment
1.8.20
1.5.0
8.0.2
The text was updated successfully, but these errors were encountered: