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

Julian Reschke <julian.reschke@gmx.de> Fri, 30 December 2011 10:41 UTC

Return-Path: <julian.reschke@gmx.de>
X-Original-To: apps-discuss@ietfa.amsl.com
Delivered-To: apps-discuss@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id A0BF521F8B40 for <apps-discuss@ietfa.amsl.com>; Fri, 30 Dec 2011 02:41:27 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -103.341
X-Spam-Level:
X-Spam-Status: No, score=-103.341 tagged_above=-999 required=5 tests=[AWL=-0.742, BAYES_00=-2.599, USER_IN_WHITELIST=-100]
Received: from mail.ietf.org ([12.22.58.30]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id znF1o++kQ-eV for <apps-discuss@ietfa.amsl.com>; Fri, 30 Dec 2011 02:41:27 -0800 (PST)
Received: from mailout-de.gmx.net (mailout-de.gmx.net [213.165.64.22]) by ietfa.amsl.com (Postfix) with SMTP id A4A3421F8B1F for <apps-discuss@ietf.org>; Fri, 30 Dec 2011 02:41:26 -0800 (PST)
Received: (qmail invoked by alias); 30 Dec 2011 10:41:25 -0000
Received: from p3EE2751C.dip.t-dialin.net (EHLO [192.168.178.36]) [62.226.117.28] by mail.gmx.net (mp072) with SMTP; 30 Dec 2011 11:41:25 +0100
X-Authenticated: #1915285
X-Provags-ID: V01U2FsdGVkX1969G0j+Ch6JLa43fTCfQqF6CNyK2A8EBeh65jCVL L4Z1hapQfMtL44
Message-ID: <4EFD954B.3090006@gmx.de>
Date: Fri, 30 Dec 2011 11:41:15 +0100
From: Julian Reschke <julian.reschke@gmx.de>
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:9.0) Gecko/20111222 Thunderbird/9.0.1
MIME-Version: 1.0
To: Sam Johnston <samj@samj.net>
References: <4ED64A26.5030003@gmx.de> <BC564D94-6D00-4D63-863A-8AAD00E57B3A@tzi.org> <4ED77513.3070506@gmx.de> <6E443D75-D1AC-451F-9B17-115C9A6C7696@mnot.net> <4ED7F8C2.9030804@gmx.de> <37E09A53-E9F4-45D2-BB8F-79655BECDBB2@mnot.net> <1322779521.1958.1.camel@neutron> <4EFC8A08.7000105@gmx.de> <1325222688.18477.25.camel@neutron> <CAKTR03_GdgdTwJF073uV1iUGSEW1E6wXxO-OtYpWReARBhRMgQ@mail.gmail.com>
In-Reply-To: <CAKTR03_GdgdTwJF073uV1iUGSEW1E6wXxO-OtYpWReARBhRMgQ@mail.gmail.com>
Content-Type: text/plain; charset="windows-1252"; format="flowed"
Content-Transfer-Encoding: 8bit
X-Y-GMX-Trusted: 0
Cc: IETF Apps Discuss <apps-discuss@ietf.org>
Subject: Re: [apps-discuss] more feature requests, was: JSON patch: "test" operation
X-BeenThere: apps-discuss@ietf.org
X-Mailman-Version: 2.1.12
Precedence: list
List-Id: General discussion of application-layer protocols <apps-discuss.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/apps-discuss>, <mailto:apps-discuss-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/apps-discuss>
List-Post: <mailto:apps-discuss@ietf.org>
List-Help: <mailto:apps-discuss-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/apps-discuss>, <mailto:apps-discuss-request@ietf.org?subject=subscribe>
X-List-Received-Date: Fri, 30 Dec 2011 10:41:27 -0000

On 2011-12-30 11:09, Sam Johnston wrote:
> On Fri, Dec 30, 2011 at 6:24 AM, Paul C. Bryan <paul.bryan@forgerock.com
> <mailto:paul.bryan@forgerock.com>> wrote:
>
>
>     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.
>
>
> Maybe so, but saying what you're doing when manipulating an object is
> often a good idea.
>
>     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).
>
>
> The distinction between data and metadata isn't always clear — to me a
> document detailing manipulations could just as easily be separated from
> the description of it (or it could be redundant — with the headers
> reflecting data contained within the document). It's also not always
> possible to define what goes in a document, so if you have metadata
> (like commit messages) then I'd argue you should use HTTP's existing
> metadata channel rather than an "envelope" like SOAP (or JSON).

I think both are valid points of view :-)

As a data point: when I submit a hg patch to Mozilla, I specify the 
commit message in-band. I think that's a very useful thing to have.

>     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?
>
>
> To me this sounds dangerous — add versioning and if there's sufficient
> demand for extensions then just include them in a future version?

So yes, we need to state whether the format follows the 
"must-understand" or "must-ignore" pattern. Or allow optional parameters 
(such as a commit message) to be marked as such.

>>     2) The ability to *copy* (not *move*) objects around.
>     This is another example of something trivial for the patch
>     implementation to perform, so I'm inclined to add it to the next draft.
>
>
> This begs the question as to whether PATCH should be creating new
> resources; the scope of PATCH ("to modify an existing HTTP resource") is

Of course that depends on how you define the lifetime of a resource. 
Does a resource which currently doesn't have a retrievable 
representation "exist"?

Technically, PATCH can work for creating an initial mapping as well.

> fairly clear on this IMO. Furthermore, MOVE and COPY verbs are useful
> for other applications (e.g. cloud APIs) so promoting them from WebDAV,
> sans XML dependency, would likely be useful for other applications.

I agree that COPY and MOVE are good things if you indeed want to COPY or 
MOVE full resources (or hierarchies). I never understood the resistance 
to COPY and MOVE in the AtomPub community.

That being said: the proposal is for copying JSON object members, not 
HTTP resources; so this is an operation that can't be done with COPY 
unless you have HTTP mappings for each of the JSON object members (and 
even then you wouldn't be able to express them as part of a bigger PATCH 
operation).

Best regards, Julian