kordlib / Lavalink.kt

Coroutine based client for Lavalink (Kotlin and Java)
MIT License
36 stars 10 forks source link

Cannot use polymorphic serializers on JS (Required by Gateway and RoutePlanner API) #4

Closed DRSchlaubi closed 2 years ago

DRSchlaubi commented 3 years ago
On Kotlin/JS explicitly declared serializer should be used for interfaces and enums without @Serializable annotation
SerializationException: Serializer for class 'GatewayPayload' is not found.
Mark the class as @Serializable or provide the serializer explicitly.
On Kotlin/JS explicitly declared serializer should be used for interfaces and enums without @Serializable annotation
    at <global>.platformSpecificSerializerNotRegistered(kotlin\lavakord-jsIr-test.js:81560)
    at <global>.serializer(kotlin\lavakord-jsIr-test.js:76486)
    at json.CommandsTest.testPlayCommand(kotlin\lavakord-jsIr-test.js:104119)
    at _no_name_provided__471.invoke(kotlin\lavakord-jsIr-test.js:106732)
    at Context.<anonymous>(kotlin\lavakord-jsIr-test.js:106513)
    at <global>.processImmediate(internal/timers.js:456)

See: Kotlin/kotlinx.serialization#1078

DRSchlaubi commented 3 years ago

Workaround has been implemented https://github.com/Kotlin/kotlinx.serialization/issues/1078#issuecomment-761873183

DRSchlaubi commented 2 years ago

This has been fixed