```@Serializable data class Reader( var na...
# ktor
m
Copy code
@Serializable
data class Reader(
        var name : String = "",
        var photoUrl : String = "",
        var address : Address = Address())
Kotlinx Serialization setup
When I configure Kotlinx Serialization in this way,
and try to POST some JSON, I get this error:
Address
is this
Can somebody point me to setting up this properly?
r
Do you have kotlinx-serialization gradle plugin applied?
👍🏼 1
j
The message is saying about a class “Reader”. Do you have any class in your code called like that missing a @Serializable annotation?
m
@rudolf.hladik The docs (https://ktor.io/servers/features/content-negotiation/serialization-converter.html) didn't mention about applying a plugin. Thanks a lot!
@jorge.rego Indeed! I posted it as the first message in this same thread 🙂
r
@manlan it’s only in kotlinx.serialization, https://github.com/Kotlin/kotlinx.serialization
m
Yes, that's where I saw the guide. But ktor should improve the docs, which is being done anyway 🙂
j
Actually I think docs are pretty ok, at least in server side, compared with other tools. Maybe it is just the amount of things you can do… xD It is a bit weird that you need to apply a plugin… with Gson it is not needed for serialization…
r
because Gson uses reflection, kotlinx.serialization don’t
❤️ 1
👍🏼 1