use of com.yahoo.elide.jsonapi.models.Patch in project elide by yahoo.
the class JsonApiPatch method processJsonPatch.
/**
* Process json patch.
*
* @param dataStore the dataStore
* @param uri the uri
* @param patchDoc the patch doc
* @param requestScope request scope
* @return pair
*/
public static Supplier<Pair<Integer, JsonNode>> processJsonPatch(DataStore dataStore, String uri, String patchDoc, PatchRequestScope requestScope) {
List<Patch> actions;
try {
actions = requestScope.getMapper().readJsonApiPatchExtDoc(patchDoc);
} catch (IOException e) {
throw new InvalidEntityBodyException(patchDoc);
}
JsonApiPatch processor = new JsonApiPatch(dataStore, actions, uri, requestScope);
return processor.processActions(requestScope);
}
Aggregations