Skip to content

Kotlin SDK error when deleting an endpoint #1117

Closed

Description

It looks like the Kotlin SDK has same endpoints that aren't working well because it tries to use Unit (I assume as a no-content?) which fails with the below error. Maybe we need a way to (de?)serialize Unit, or alternatively fix the generator not to use Unit at all.

Code

fun main() {
    val svix = Svix("key")
    runBlocking {
        svix.endpoint.delete("appId", "endpointId") // <-- this throws the exception
    }
}

Exception

Exception in thread "main" java.lang.IllegalArgumentException: Platform class kotlin.Unit requires explicit JsonAdapter to be registered
                at com.squareup.moshi.ClassJsonAdapter$1.create(ClassJsonAdapter.java:75)
                at com.squareup.moshi.Moshi.adapter(Moshi.java:145)
                at com.squareup.moshi.Moshi.adapter(Moshi.java:105)
                at com.squareup.moshi.Moshi.adapter(Moshi.java:79)
                at com.svix.kotlin.internal.apis.EndpointApi.v1EndpointDelete(EndpointApi.kt:1506)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

Labels

bugSomething isn't workinglib/kotlinKotlin client library

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions