https://kotlinlang.org logo
Title
l

Lucas Ribeiro

01/31/2018, 12:30 PM
just to make sure that is a issue with the
@Json
annotation, if you remove the annotation and name the variable with the name that you receive on json, it's work ?
j

Joe

01/31/2018, 1:18 PM
So even if I leave the annotation but change the variable name to match the json, it will work correctly. So this works:
@Json(name = "home_id") val home_id: String = "",
So the Json attribute is definitely being ignored.
l

Lucas Ribeiro

01/31/2018, 1:29 PM
yep, did you tried with
@field:Json
?
j

Joe

01/31/2018, 1:29 PM
Trying now
Yes, that works and I didn’t even need to roll back the version of moshi-kotlin I was using.
So it’s not ideal, but as far as easy solutions go, I’ll take it. 🙂 Thanks for your help!
👍 1
Okay, not quite as successful as I thought. The annotations are now ignored in the non-Proguarded builds. 🙄
Seems I just can’t have it both ways.
l

Lucas Ribeiro

01/31/2018, 3:39 PM
hahahaha that'`s does not makes sense, the non-proguarded build should not impact the serialization
j

Joe

01/31/2018, 3:40 PM
Yep