I have a retrofit api interface with a method that looks like this:
<code> @GET("/data")
suspend fun getData(): DataDto?
</code>
<code> @GET("/data")
suspend fun getData(): DataDto?
</code>
@GET("/data")
suspend fun getData(): DataDto?
The server in this instance is returning a 200, and the json response body is null
(bare string, no quotes).
This results in an exception:
<code>java.util.concurrent.ExecutionException: kotlinx.serialization.json.internal.JsonDecodingException: Unexpected JSON token at offset 0: Expected start of the object '{', but had 'n' instead at path: $
JSON input: null
</code>
<code>java.util.concurrent.ExecutionException: kotlinx.serialization.json.internal.JsonDecodingException: Unexpected JSON token at offset 0: Expected start of the object '{', but had 'n' instead at path: $
JSON input: null
</code>
java.util.concurrent.ExecutionException: kotlinx.serialization.json.internal.JsonDecodingException: Unexpected JSON token at offset 0: Expected start of the object '{', but had 'n' instead at path: $
JSON input: null
I don’t think I change the backend at this point. Is there any way to get this to work?