I updated ktor to `2.3.4` from `2.3.1` and suddenl...
# ktor
e
I updated ktor to
2.3.4
from
2.3.1
and suddenly I get this error:
Copy code
Serializer for class 'Id' is not found.
Please ensure that class is marked as '@Serializable' and that the serialization compiler plugin is applied.
see the code below:
Copy code
// resource definition:
import io.ktor.resources.Resource

@Resource("/foos")
class FooResources {
    @Resource("create")
    class New(val parent: FooResources = FooResources(), val name: String)

    @Resource("{id}")
    class Id(val parent: FooResources = FooResources(), val id: Int) {
        @Resource("edit")
        class Edit(val parent: Id, val name: String)
    }
}

// client call:
val client = createClient {
    install(Resources)
}
client.get(FooResources.Id(id = fooId))
Any clues what changed? I don't really want to go and start annotate all the resources with serializable just to be able to use type-safe requests
a
Unfortunately, I cannot reproduce your problem. The
@Serializable
annotation for the resources became redundant since Ktor 2.2.2.
e
the error stacktrace starts with this:
Copy code
at app//kotlinx.serialization.internal.Platform_commonKt.serializerNotRegistered(Platform.common.kt:92)
	at app//kotlinx.serialization.internal.PlatformKt.platformSpecificSerializerNotRegistered(Platform.kt:28)
	at app//kotlinx.serialization.SerializersKt__SerializersKt.serializer(Serializers.kt:134)
	at app//kotlinx.serialization.SerializersKt.serializer(Unknown Source)
	at app//kotlinx.serialization.SerializersKt__SerializersKt.serializer(Serializers.kt:72)
	at app//kotlinx.serialization.SerializersKt.serializer(Unknown Source)
maybe something is pulled in secretly
figured out. Forgot to update the serialization plugin from 1.8.0 to 1.9.0
👍 1