I am currently struggling for best way to add property to existing jsonObject(kotlinx.serialization.json.JsonObject)
Even I have found that JsonObject internally has private immutable map
private val content: Map<String, JsonElement>
Scenario: Suppose I already have one jsonObject with 50 properties in it and considering jsonObject at any key can have any number of depth.
For such situation how can we efficiently perform below operations:
- Adding primitive properties
- Updating primitive properties
- Deleting primitive properties
FYI : Even I have found there is class called JsonObjectBuilder but it does not take existing JsonElement / JsonObject / JsonArray infact it will newly create another jsonObject.
Thanks for giving your time to read till here