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

Sam Johnston <samj@samj.net> Fri, 30 December 2011 11:37 UTC

Return-Path: <samj@samj.net>
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 0ACE621F8C00 for <apps-discuss@ietfa.amsl.com>; Fri, 30 Dec 2011 03:37:01 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -5.56
X-Spam-Level:
X-Spam-Status: No, score=-5.56 tagged_above=-999 required=5 tests=[AWL=0.417, BAYES_00=-2.599, FM_FORGED_GMAIL=0.622, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_MED=-4]
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 1WDWwtlkrF5Z for <apps-discuss@ietfa.amsl.com>; Fri, 30 Dec 2011 03:37:00 -0800 (PST)
Received: from eu1sys200aog109.obsmtp.com (eu1sys200aog109.obsmtp.com [207.126.144.127]) by ietfa.amsl.com (Postfix) with ESMTP id 3CACD21F8BF4 for <apps-discuss@ietf.org>; Fri, 30 Dec 2011 03:36:59 -0800 (PST)
Received: from mail-gx0-f172.google.com ([209.85.161.172]) (using TLSv1) by eu1sys200aob109.postini.com ([207.126.147.11]) with SMTP ID DSNKTv2iSSM2guSTc1KYitYmCsc/8fnP+CuE@postini.com; Fri, 30 Dec 2011 11:36:59 UTC
Received: by mail-gx0-f172.google.com with SMTP id k5so12007049ggn.17 for <apps-discuss@ietf.org>; Fri, 30 Dec 2011 03:36:41 -0800 (PST)
Received: by 10.101.137.7 with SMTP id p7mr15639493ann.34.1325245001396; Fri, 30 Dec 2011 03:36:41 -0800 (PST)
MIME-Version: 1.0
Received: by 10.236.143.100 with HTTP; Fri, 30 Dec 2011 03:36:20 -0800 (PST)
In-Reply-To: <4EFD954B.3090006@gmx.de>
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> <4EFD954B.3090006@gmx.de>
From: Sam Johnston <samj@samj.net>
Date: Fri, 30 Dec 2011 12:36:20 +0100
Message-ID: <CAKTR03_XZOW3HK4MLjG8n+-SmCBp68Zym4S-g6vj3NXa-=kHfQ@mail.gmail.com>
To: Julian Reschke <julian.reschke@gmx.de>
Content-Type: multipart/alternative; boundary="0016e68fcfa38c73ee04b54da554"
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 11:37:01 -0000

On Fri, Dec 30, 2011 at 11:41 AM, Julian Reschke <julian.reschke@gmx.de>wrote:

>
>> 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.


For a patch format, agreed — so include it (as optional). In saying "it's
also not always
possible to define what goes in a document" I mean that as a user you may
have needs not considered by the document format authors. For example, you
may want to include a link to an issue tracking system — do you extend the
format or use a Link: header? I know what I'd do.

Another more generic example I like to use is a photo hosting site — while
photo formats (e.g. JPEG) now carry metadata channels (e.g. EXIF) I'd
rather be able to glean semantic information (e.g. links, attributes,
categories) from the headers than having to retrieve and parse the resource
for an embedded resource that itself has to be parsed!

Anyway this is getting off-topic — in this case I think there's
justification for native in-band support, possibly with link references too.


>
>     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.


IMO a patch format (c.f. diff) should be "must-understand", even if some
parameters are made optional.


>
>     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.


That's a contrived interpretation — is it something we want to support? I'd
rather a PATCH throw a 4xx error if a resource didn't exist... an empty PUT
would create a resource that could then be PATCHed, no?


>  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).
>

Ah, that makes a lot more sense now, though it does sound like a premature
optimisation.

Sam