You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi There, I'm having some issues when trying to read String value from Http responses on moshi 1.13.0 and using moshi converter 2.9.0
Data class value are defined as: @Json(name = "profession") val _profession: String?,
And value from server is: "profession": "dev web"
The error is com.squareup.moshi.JsonEncodingException: Unterminated object at path $.candidate_data.profession
Doing some debugging I found that when value are peeking, the json reader just assign first word dev to _profession, keeping " web" on buffer, so when try to read another key, it crashes.
Does anyone know how can I solve this issue?
I'm serializing the value using adapter with lenient() option and reading from response.body().toString()
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi There, I'm having some issues when trying to read String value from Http responses on moshi 1.13.0 and using moshi converter 2.9.0
Data class value are defined as:
@Json(name = "profession") val _profession: String?,
And value from server is:
"profession": "dev web"
The error is
com.squareup.moshi.JsonEncodingException: Unterminated object at path $.candidate_data.profession
Doing some debugging I found that when value are peeking, the json reader just assign first word dev to _profession, keeping " web" on buffer, so when try to read another key, it crashes.
Does anyone know how can I solve this issue?
I'm serializing the value using adapter with lenient() option and reading from
response.body().toString()
Beta Was this translation helpful? Give feedback.
All reactions