Skip to content

Write serializable class for this sample #109

Discussion options

You must be logged in to vote

I figured out that with this set of classes:

@Serializable
@XmlSerialName("languages", "http://www.w3.com/info", "")
data class Languages(
    @XmlElement(true)
    val language: MutableList<Language>
) {
    @Serializable
    @XmlSerialName("language", "http://www.w3.com/info", "")
    data class Language(
        @XmlElement(false)
        @XmlSerialName("code", "", "")
        val code: String,
        @XmlElement(false)
        @XmlSerialName("base", "", "")
        val base: Boolean,
        @XmlValue(true)
        val name: String
    )
}

Replies: 1 comment

Comment options

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