I have this json string
{
"team": "xyz",
"patern": "abc",
"service": "{\"version\":0,\"name\":\"some_service_name\"}",
"op": "{\"version\":0,\"name\":\"some_op_name\"}",
.
.
.
}
and would like to convert it into JsonObject, since it has a json string inside I have to pull out the JsonElement and then use it. The problem is JsonElement "service" and "op" are String
I would like the JsonObject to be converted like this
{
"team": "xyz",
"patern": "abc",
"service": {"version":0,"name":"some_service_name"},
"op": {"version":0,"name":"some_op_name"},
.
.
.
}
I have tried new JsonParser().parse(string) and also new Gson().fromJson(string, JsonObject.class) but it doesn't resolve. Also tried Jolt but it parses it as String.
I know that this can be solved by mapping it to a java class and then use it but I would like to know if there is a way to get away without additional java class.