-
Hi, I need some help with a basic polymorphic example. Suppose we have 2 classes, @Serializable
class Parent(val components: List<@Polymorphic Foo> = listOf())
interface Foo
@Serializable
class Bar(val name: String) : Foo
@Serializable
class Buzz(val id: Int) : Foo Now let's assume the following XML: <Parent>
<Bar name="alice" />
<Buzz id="1" />
</Parent> With the above code I am unable to parse this XML file as I am hit with the Thanks |
Beta Was this translation helpful? Give feedback.
Answered by
theovier
Aug 7, 2021
Replies: 1 comment 1 reply
-
After some digging I found this test case which shows exactly how to achieve this basic polymorphism. |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
theovier
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
After some digging I found this test case which shows exactly how to achieve this basic polymorphism.