Open FeldrinH opened 1 year ago
This could be accomplished by a shim that gets the String from one form and parses into the other... not sure if this should be done in this library of as an external wrapper using something like this:
import com.fasterxml.jackson.databind.JsonNode;
import com.google.gson.JsonElement;
import com.google.gson.JsonParser;
static ObjectMapper _objectMapper = new ObjectMapper();
public static class GSONConverter {
static public JsonElement toGSON(JsonNode node) throws Exception {
return JsonParser.parseString(_objectMapper.writeValueAsString(node));
}
}
It seems that it is currently only possible to pass JSON in and get JSON out as Jackson
JsonNode
. It would be nice if it was possible to use JSON representations from other libraries as well, such as Gson'sJsonElement
.