-
Notifications
You must be signed in to change notification settings - Fork 23
Closed
Labels
2.14Intended for version 2.14.xIntended for version 2.14.xjsr-353Issue related to JSR-353/JSONP datatype moduleIssue related to JSR-353/JSONP datatype module
Milestone
Description
To simplify the serialization of json-p patch objects, proposing adding delegating serializers for JsonPatch>JsonArray and JsonMergePatch>JsonValue
It takes extra steps to convert a patch into a type that has a serializer available.
addSerializer(JsonPatch.class, new StdDelegatingSerializer(new Converter<JsonPatch, JsonArray>() {
@Override
public JsonArray convert(JsonPatch value) {
return value.toJsonArray();
}
@Override
public JavaType getInputType(TypeFactory typeFactory) {
return typeFactory.constructFromCanonical(JsonPatch.class.getName());
}
@Override
public JavaType getOutputType(TypeFactory typeFactory) {
return typeFactory.constructFromCanonical(JsonArray.class.getName());
}
}));
Metadata
Metadata
Assignees
Labels
2.14Intended for version 2.14.xIntended for version 2.14.xjsr-353Issue related to JSR-353/JSONP datatype moduleIssue related to JSR-353/JSONP datatype module