I have a json structure like this:
{
"version": 1.0,
"object": {
"a1": "a2",
"b1": "b2
},
"deploy": {
"applicationName": "app",
"namespace": "com.abc.xyz"
...
}
}
The ... means the JSON continues more. I want to retrieve the namespace from this JSON. My code looks like this:
JsonNode rootNode = new ObjectMapper().readTree(json);
var result = rootNode.at("/deploy/namespace");
However, with this code, result will always ""
I've tried different paths but I'm always getting an empty String.
Any help?