• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
  • Bear Bibeault
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Piet Souris
  • salvin francis
  • Stephan van Hulst
Bartenders:
  • Frits Walraven
  • Carey Brown
  • Jj Roberts

Loop through a JsonNode and its fields [Kotlin]

 
Ranch Hand
Posts: 69
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
my requirement is to be able to loop through the following JsonNode and its elements:



Each iteration should present a JsonNode with its elements until no JsonNode object is found. I have started with the following:



Is this a valid approach? Ultimately, I would like to get each element in the JsonNode with its associated values. Ideally, my function should return a JsonNode. Down the line, I would also like to use the id in a repository query, so what would be the best approach? Shall I convert it into a Map? Something along these lines:



Can you help? I am not quite sure how to go about it.

Thank you
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic