1

I have a JsonNode which looks like:

[
  {
    "ObjectIWantToRetrieve": {
      "key0": {
        "key1": {
          "key2": "val3"
          ]
        }
      }
    }
  }
]

I wish to get the ObjectIWantToRetrieve out The equivalent of JsonNode.get("ObjectIWantToRetrieve"). Can anyone help me? Should I be converting the JSONNode to ArrayNode Please advice thank you

Blake
  • 157
  • 4
  • 13

1 Answers1

1

You should convert it to ObjectNode first like this :

ObjectNode value = ((ObjectNode) JsonNode.get(0)).get("ObjectIWantToRetrieve")
Jordy
  • 1,802
  • 2
  • 6
  • 25