-
Notifications
You must be signed in to change notification settings - Fork 672
Fix Polymorphic Deserialization Error with Subclass using JsonTransformingSerializer #3139
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
base: dev
Are you sure you want to change the base?
Changes from 3 commits
e40d112
55c02a3
56bf91e
28af339
8a1f5d5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -18,7 +18,7 @@ import kotlin.jvm.* | |
| @JsonFriendModuleApi | ||
| public fun <T> readJson(json: Json, element: JsonElement, deserializer: DeserializationStrategy<T>): T { | ||
| val input = when (element) { | ||
| is JsonObject -> JsonTreeDecoder(json, element) | ||
| is JsonObject -> JsonTreeDecoder(json, element, deserializer.descriptor.classDiscriminator(json)) | ||
|
||
| is JsonArray -> JsonTreeListDecoder(json, element) | ||
| is JsonLiteral, JsonNull -> JsonPrimitiveDecoder(json, element as JsonPrimitive) | ||
| } | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please do not add irrelevant changes to the PR, especially if they're about formatting.