public void updateUser(User user, Response response) {}
final Gson gson = new GsonBuilder()
.excludeFieldsWithoutExposeAnnotation()
.excludeFieldsWithModifiers(java.lang.reflect.Modifier.TRANSIENT)
.create();
Type listType = new TypeToken<List<MyClass>>() {}.getType();
String jsonElem = gson.toJson(test, listType);
return RestResponse.ok(test);
The above code hangs on the last line. Using JsonElement and its toString() causes the json data to get extra quotes. Any ideas ?