I need to change a JSON attribute\'s value in Java, I can get the value properly but I couldn\'t modify the JSON.
here is the code below
JsonNode
JsonNode is immutable and is intended for parse operation. However, it can be cast into ObjectNode (and ArrayNode) that allow mutations:
ObjectNode
ArrayNode
((ObjectNode)jsonNode).put("value", "NO");
For an array, you can use:
((ObjectNode)jsonNode).putArray("arrayName").add(object.getValue());