Skip to content

PolymorphismStyle.None resulting in an error #514

Answered by charleskorn
PhilippNowak96 asked this question in Q&A
Discussion options

You must be logged in to vote

PolymorphismStyle.None does not support deserializing at all - it is for serialization only.

In your case, I'd suggest creating a custom serializer for the Param type that constructs the correct subtype of Param based on the value of valueType. There's more information about this in the kotlinx.serialization docs here. (Note that the examples refer to JSON, but the same ideas apply for YAML.)

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@PhilippNowak96
Comment options

Answer selected by charleskorn
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants