I have the following data class:
data class Thing(
val id: Long?,
val title: String,
val description: String,
)
In my Api :
@POST("doThings")
fun createThings(
@Query("thing") thing: Thing
): Call<StatusResponse>
I got the error: status":500,"error":"Internal Server Error","message":"Unexpected character ('E' (code 69))
In the spring api I made a log output and the data class object arrived as:
"Thing(id=null, title=Something, description=Something more)"
The Retrofit Builder has the GSON Converter but I guess it doesn't work properly:
Retrofit.Builder()
.client(get())
.baseUrl(get<Context>().getString(R.string.base_url))
.addCallAdapterFactory(get<CoroutineCallAdapterFactory>())
.addConverterFactory(get<GsonConverterFactory>())
.build()
Any suggestions? Thanks