Subject: Re: [apps-discuss] more feature requests, was: JSON patch: "test" operation

From: Julian Reschke <[email-masked]>
Date: Tue, 20 Mar 2012 17:12:38 +0100

On 2011-12-30 06:24, Paul C. Bryan wrote:
> On Thu, 2011-12-29 at 16:40 +0100, Julian Reschke wrote:
>> Hi there,
>>
>> in discussions in Apache Jackrabbit space, two more features have been
>> mentioned as potentially useful:
>>
>> 1) The ability to send additional data along with the actual patch; such
>> as a plain text string describing the change (think "commit" message),
>> or user information.
>
> I've had a few thoughts here.
>
> First, I think commit messages should probably be out of scope for JSON
> Patch specifically. That said, we should allow the ability to build on
> the specified format, allowing for extensions, including additional
> (more domain-specific) operations.
>
> I'm generally against the idea of using out-of-band metadata such as
> header fields in an HTTP request, mostly because it ties metadata to the
> transfer protocol rather (what I believe rightly should be tied to the
> document).
>
> I'm interested in feedback on the possibility that I add text stating
> that if an operation cannot be determined for a given patch object, then
> an implementation should ignore it. Thoughts?
> ...

That's exactly the question we need to answer; is the extensibility 
model "must understand" or is it "must ignore"? In the latter case, 
people can define their own operators, such as "commit-message". But of 
course it would make it harder to define new operators later on.

If JSON had a comment syntax there would be a simple, although a bit 
hacky way to extend the format. But it does not...

Best regards, Julian

---

From: "Paul C. Bryan" <[email-masked]>
Date: Tue, 20 Mar 2012 09:34:03 -0700

This was discussed previously, and the consensus at the time was for
must-understand.

Paul

On Tue, 2012-03-20 at 17:12 +0100, Julian Reschke wrote:

> _______________________________________________
> apps-discuss mailing list
> [email-masked]
> https://www.ietf.org/mailman/listinfo/apps-discuss

---

From: Julian Reschke <[email-masked]>
Date: Tue, 20 Mar 2012 17:46:54 +0100

> This was discussed previously, and the consensus at the time was for

OK; in which case 
<http://trac.tools.ietf.org/html/draft-ietf-appsawg-json-patch-01#section-4> 
should state this as an error condition. It currently says:

    The operation to perform is expressed in a member of the operation
    object.  The name of the operation member is one of: "add", "remove",
    "replace", "move", "copy" or "test".  The member value is a string
    containing a [JSON-Pointer] value, which references the location
    within the target document to perform the operation.  It is an error
    condition if an operation object contains no recognized operation
    member or more than one operation member.

So

     { "test": "/a/b/c", "value": "foo", "julians-extension" : "bar" }

would be legal (so you could augment each operation with additional 
information, but not the patch document itself).

Best regards, Julian