Closed afinas-wii closed 5 years ago
You can parse meta attribute by implementing a JsonAdapter
as is mentioned here. And use JsonBuffer.get(JsonAdapter)
for deserialization and JsonBuffer.create(JsonAdapter, Object)
for serialization.
Thanks for your response. But I'm still facing the issue, This is my meta object, And how can I parse this.
"meta": {
"totalPages": 11,
"nextPage": 2,
"pageSize": 10
}
Create a new class for your metadata and create a JsonAdapter
from it as which is demonstrated by the moshi example.
Then,
You can parse meta attribute by implementing a
JsonAdapter
as is mentioned here. And useJsonBuffer.get(JsonAdapter)
for deserialization andJsonBuffer.create(JsonAdapter, Object)
for serialization.
I am trying to parse metadata from a JosnApi for accessing fields inside
"meta":{...}
. What I'm getting is a JsonBuffer and I don't know how to parse data with this.Thank you.