You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Aug 10, 2023. It is now read-only.
Currently, JsonArrayBuilder and JsonObjectBuilder can be used to create JSON object models from scratch. However, the process is cumbersome and verbose. There should be an easier way for doing this.
I am proposing something like the following:
JsonArray a = JsonUtil.getArray(
"[{'abc': 'xyz', 'ss': 1234}, {'m\\'n': 'l\"m'}]");
Note that I'm using single quotes for JSON strings, otherwise I'll have lots of " as required in Java. I am not proposing allowing single quotes for JSON string (which is not allowed in JSON) in general. This utility will need to convert ' to " before sending it to JsonReader.
Note also \ is used to allow ' or " inside the JSON string, but this is just some details that we should not worry for now.
Such utility will be very useful in writing JSON tests. But it should be useful to JSON users.