Slackbot
08/24/2022, 10:43 PMDavid Nedrow
08/24/2022, 11:15 PMdata class News (
val error: String, // Boolean?
val category: String,
val type: String, // Should this be an enum
val setup: String,
val delivery: String,
val flags: Flags,
val id: String, // UInt?
val safe: String, // Boolean?
val lang: String
)
data class Flags (
// These could be Boolean
val nsfw: String,
val religious: String,
val political: String,
val racist: String,
val sexist: String,
val explicit: String
)
…making the fields optional where needed.DavdF
08/24/2022, 11:43 PMCaused by: nl.adaptivity.xmlutil.serialization.UnknownXmlFieldException: Could not find a field for name News/error
candidates: error, category, type, setup, delivery, Flags, id, safe, lang at position [row,col {unknown-source}]: [3,5]
David Nedrow
08/25/2022, 4:18 PMBoolean
rather than String
.@Serializable
?DavdF
08/26/2022, 11:39 PMimport io.ktor.serialization.kotlinx.xml.*
for the XML certification. I have switch to just parcing the the XML first and then turning it into JSON to send back out to the client.io.ktor.serialization.kotlinx.xml.*
Needs a lot better documentation!David Nedrow
08/29/2022, 1:09 PMhhariri
08/30/2022, 1:35 PMmarlonlom
09/05/2022, 2:27 PMhttps://jsonformatter.org/xml-to-kotlin
data class Data (
val error: String,
val category: String,
val type: String,
val setup: String,
val delivery: String,
val flags: Flags,
val id: String,
val safe: String,
val lang: String
)
data class Flags (
val nsfw: String,
val religious: String,
val political: String,
val racist: String,
val sexist: String,
val explicit: String
)