We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Describe the bug Decoder#decodeSerializableValue ignores JsonConfiguration#ignoreUnknownKeys and an JsonDecodingException is thrown.
Decoder#decodeSerializableValue
JsonConfiguration#ignoreUnknownKeys
JsonDecodingException
To Reproduce https://gist.github.com/DSeeLP/c5055f616ad0b7e4337cdadd24d1c4e5
Expected behavior It should deserialize it to FineRestResponse(value=kotlin.Unit) and discard the unknown keys.
FineRestResponse(value=kotlin.Unit)
Environment
The text was updated successfully, but these errors were encountered:
In your example you're using Unit which is not serializable.
Unit
If you add this class
@Serializable class Discard // this could be named however you want
and then change the line
println(json.decodeFromString<RestResult<Unit>>(inputText))
for
println(json.decodeFromString<RestResult<Discard>>(inputText))
you'll see that it works as intended and and is in fact respecting the ignoreUnknownKeys setting.
ignoreUnknownKeys
Sorry, something went wrong.
Properly skip unknown keys for objects and structures with zero prope…
3e91c70
…rties Fixes #1713
c06ebb4
qwwdfsad
No branches or pull requests
Describe the bug
Decoder#decodeSerializableValue
ignoresJsonConfiguration#ignoreUnknownKeys
and anJsonDecodingException
is thrown.To Reproduce
https://gist.github.com/DSeeLP/c5055f616ad0b7e4337cdadd24d1c4e5
Expected behavior
It should deserialize it to
FineRestResponse(value=kotlin.Unit)
and discard the unknown keys.Environment
The text was updated successfully, but these errors were encountered: