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

1 Answer 1

1

You should convert it to ObjectNode first like this :

ObjectNode value = ((ObjectNode) JsonNode.get(0)).get("ObjectIWantToRetrieve")
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.