• Post Reply Bookmark Topic Watch Topic
  • New Topic

Coping with differing Json object names  RSS feed

 
M Bryan
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

from a website I am getting a request in json format. It roughly looks like this:



Usually, I would write something like jsonObject.getAsJsonObject("343153"), but this does not work in this case, since the IDs differ.
How can I extract that two entries into something like a list?

Thank you
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65833
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It might help to mention which JSON library you are using.
 
M Bryan
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Google gson
 
M Bryan
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Okay I found it out: jo.entrySet();
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!