Class ApplyPatchService

  • All Implemented Interfaces:
    AdaptrisComponent, ComponentLifecycle, ComponentLifecycleExtension, MessageEventGenerator, Service, StateManagedComponent

    @ComponentProfile(summary="Apply a JSON patch diff to a document",
                      tag="service,json,jsonpatch",
                      since="3.9.0")
    public class ApplyPatchService
    extends JsonPatchService
    Apply a JSON patch diff.

    JSON Patch defines a JSON document structure for expressing a sequence of operations to apply to a JavaScript Object Notation (JSON) document.

    For a given source of {"a": 0,"b": [1,2]} and a patch-source of [{"op":"move","from":"/a","path":"/b/2"}] then when executing this service you would expect to get {"b": [1,2,0]} to be stored against the configured output parameter.

    Note that zjsonpatch operates on JsonNode objects; this means keeping the node trees in memory, so behaviour will be size/memory dependent.

    In the adapter configuration file this class is aliased as json-patch-apply which is the preferred alternative to the fully qualified classname when building your configuration.