Trying to get kotlinx.serialization working on jvm...
# ktor
j
Trying to get kotlinx.serialization working on jvm with ktor client (cio) but I keep getting a very unhelpful error
b
You have to read down for other exceptions that caused the failure
Can't locate argument-less serializer for class io.codehop.friday.RTM. For generic classes, such as lists, please provide serializer explicitly
Ktor does a pretty good job of describing what caused an issue or linking to another exception that caused it
j
That doesn't help me figure out what I need to do to fix it.
Copy code
@Serializable
data class RTM(
    @Optional
    @SerialName("ok")
    val ok: Boolean = false,
    @Optional
    @SerialName("self")
    val self: Self = Self(),
    @Optional
    @SerialName("team")
    val team: Team = Team(),
    @Optional
    @SerialName("url")
    val url: String = ""
)

@Serializable
data class Self(
    @Optional
    @SerialName("id")
    val id: String = "",
    @Optional
    @SerialName("name")
    val name: String = ""
)

@Serializable
data class Team(
    @Optional
    @SerialName("domain")
    val domain: String = "",
    @Optional
    @SerialName("id")
    val id: String = "",
    @Optional
    @SerialName("name")
    val name: String = ""
)
The class is defined correctly or so I thought
Decoding it to a string works just fine, but when going to an object it freaks.
I swear I have had this working but a few days ago
ARG delegate to gradle got turned off