Closed julianomqs closed 5 years ago
Hello @julianomqs. You can use the API JsonBuilderFactory#createArrayBuilder and JsonBuilderFactory#createObjectBuilder to modify the existing JSON array/object.
I'm really sorry, I forgot to mention I'm using Java EE 7.
I see in Java EE 8 those methods you mentioned are already present in Json
class.
Closing this issue.
Thanks a lot.
As far as I know there is no way to modify a
JsonArray
orJsonObject
after reading it withJsonReader
.I would like to read some JSON from strings and change them:
But
JsonArray
andJsonObject
are immutable, so I can't do that.So my suggestion is to add two utilities methods to achieve that:
With that two methods would be easier to write and read a JSON code and reducing the verbosity and workarounds.