Answer the question
In order to leave comments, you need to log in
How to serialize JSON if the field is not known in advance?
The Json comes in like this. The question is, if the name of the array field is not known in advance (it is not constant and will change every time), how can I properly serialize it so that I can access it later?
Answer the question
In order to leave comments, you need to log in
I think it's some sort of design flaw. if it is in your power to change something, change it as soon as possible,
for example
"cart": {
"id": "588xxxxx",
"items": [
тут содержимое
]
}
is there one for the cart node? save it, and then just do cart.keys[0].
if you use GSON, then write a custom deserializer and save to a normal model
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question