I have started to use retrofit to work with json, using jsonschema2pojo to generate my models. But i faced a problem that one field in Json can be array as well as object. Can somebody give me advise how to solve this?
Asked
Active
Viewed 202 times
0
-
What does that even mean? Do you mean an array of objects? – bmarkham Mar 08 '16 at 09:25
-
I mean it can be a single Jsonobject( {}, ) or JsonArray([{},{},...],). – mikhail kochetkov Mar 08 '16 at 09:28
1 Answers
0
I found solution. If there is a multiple choice beetwen array or object, need to change problem field class to JsonElement, change args in setters,getters and the model will be created and avalible to use.

mikhail kochetkov
- 11
- 4