Is it possible to convert from the newer EJB JSON libraries to the older org.json ones without having to rely on org.json.simple or GSON?
In the case below, "buttons" is a populated JsonArray and I'm trying to copy it into a JSONArray for legacy code. But the initialization of JSONArray from a stringified value always fails with "A JSONObject text must begin with '{'" because a quote is seen as a first character rather than a curly brace.
JSONArray newButtons = new JSONArray();
for (int i = 0; i < buttons.size(); i++) {
JsonString button = buttons.getJsonString(i);
newButtons.put(new JSONArray(button.toString()));
}
return new JSONArray(newButtons);
It doesn't seem like there is any kind of org.json object that I can initialize from a string constructor with a toString() value from the javax.json library. I have managed to move data from org.json structures to javax.json ones, but not vice versa. Is the org.json library too inflexible to do this?