Kevin Schmeichel
06/24/2019, 6:26 PMIntDeserializer()
? maybe try removing that line, gson can deserialize Ints automatically.tjohnn
06/24/2019, 6:30 PMageGroupId:""
gives me NumberFormatException: empty String
which I wanted to handle explicitly. Is there a way to handle that without adapterKevin Schmeichel
06/24/2019, 6:41 PMtjohnn
06/24/2019, 6:56 PMKevin Schmeichel
06/24/2019, 7:08 PMregisterTypeAdapterFactory(...)
?registerTypeAdapter(java.lang.Integer::class.java, adapter)
tjohnn
06/24/2019, 7:13 PMinstall(ContentNegotiation){
register(ContentType.Application.Json, GsonConverter(GsonBuilder().apply {
setFieldNamingPolicy(FieldNamingPolicy.LOWER_CASE_WITH_UNDERSCORES)
registerTypeAdapter(DateTime::class.java, DateTimeDeserializer())
registerTypeAdapter(Int::class.java, IntDeserializer())
}.create()))
}
Kevin Schmeichel
06/24/2019, 7:14 PMjava.lang.Integer::class.java
instead?tjohnn
06/24/2019, 7:15 PMKevin Schmeichel
06/24/2019, 7:15 PMtjohnn
06/24/2019, 9:44 PMjava.lang.Integer::class.java
works fine thanksInt
or what?Kevin Schmeichel
06/24/2019, 10:03 PM