android - Deserialise JSON with dynamic field -
i'm loading json dynamic field api using retrofit on android.
this example:
{ "success": true, "messages": { "success": [ "success_message" ], "error": { "specific_error": { … } } }, "session": { "id": "fj4qewqrewq43fdsa", "expire": null, "yii_csrf_token": "fda432fdafasd78978fdas" }, "metadata": {…} }
the structure of messages object can change every request. there success field , not. same goes error field. error field can array object several other objects , fields inside.
does make sense deserialise messages field different pojos , if how that? make more sense keep field json object , values object when needed?
Comments
Post a Comment