Re: [ietf-types] Request for review: application/json-patch

mike amundsen <mamund@yahoo.com> Tue, 25 October 2011 01:01 UTC

Return-Path: <mca@amundsen.com>
X-Original-To: ietf-types@ietfa.amsl.com
Delivered-To: ietf-types@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 6C3AD21F8CF1 for <ietf-types@ietfa.amsl.com>; Mon, 24 Oct 2011 18:01:53 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -0.68
X-Spam-Level:
X-Spam-Status: No, score=-0.68 tagged_above=-999 required=5 tests=[BAYES_00=-2.599, FM_FORGED_GMAIL=0.622, FORGED_YAHOO_RCVD=2.297, RCVD_IN_DNSWL_LOW=-1]
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 RmKghj8N600N for <ietf-types@ietfa.amsl.com>; Mon, 24 Oct 2011 18:01:52 -0700 (PDT)
Received: from mail-gy0-f172.google.com (mail-gy0-f172.google.com [209.85.160.172]) by ietfa.amsl.com (Postfix) with ESMTP id C6EA821F8B68 for <ietf-types@ietf.org>; Mon, 24 Oct 2011 18:01:52 -0700 (PDT)
Received: by gyh20 with SMTP id 20so7643950gyh.31 for <ietf-types@ietf.org>; Mon, 24 Oct 2011 18:01:52 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.68.28.4 with SMTP id x4mr52561119pbg.56.1319504512048; Mon, 24 Oct 2011 18:01:52 -0700 (PDT)
Sender: mca@amundsen.com
Received: by 10.142.156.11 with HTTP; Mon, 24 Oct 2011 18:01:51 -0700 (PDT)
In-Reply-To: <1319499281.2711.10.camel@neutron>
References: <1319490143.23040.8.camel@neutron> <CAPW_8m6XB0B68GnCNA-6D_5q5CFRj8jKpt1GftRYN640rjCCTg@mail.gmail.com> <1319499281.2711.10.camel@neutron>
Date: Mon, 24 Oct 2011 21:01:51 -0400
X-Google-Sender-Auth: lFCcapPDX4sigelhLbn6fJ8KWVQ
Message-ID: <CAPW_8m6ZseRu_vjFZvqHhDpvK2zzR7b6e03JP8GnUWkcaC99wg@mail.gmail.com>
From: mike amundsen <mamund@yahoo.com>
To: "Paul C. Bryan" <paul.bryan@forgerock.com>
Content-Type: text/plain; charset="ISO-8859-1"
Cc: ietf-types@ietf.org
Subject: Re: [ietf-types] Request for review: application/json-patch
X-BeenThere: ietf-types@ietf.org
X-Mailman-Version: 2.1.12
Precedence: list
List-Id: "Media \(MIME\) type review" <ietf-types.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/ietf-types>, <mailto:ietf-types-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/ietf-types>
List-Post: <mailto:ietf-types@ietf.org>
List-Help: <mailto:ietf-types-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/ietf-types>, <mailto:ietf-types-request@ietf.org?subject=subscribe>
X-List-Received-Date: Tue, 25 Oct 2011 01:01:53 -0000

responses inline....

On Mon, Oct 24, 2011 at 19:34, Paul C. Bryan <paul.bryan@forgerock.com> wrote:
> Hi Mike:
>
> Thanks for the review and comments. My responses, inline...
>
> On Mon, 2011-10-24 at 19:19 -0400, mike amundsen wrote:
>> Paul:
>>
>> checking the I-D document itself:
>>
>> Sec #4 Operations:
>> "It is an error condition if an operation object contains more than
>> one operation member."
>>
>> I am not clear on what this is telling me:
>> - the same JSON Pointer expression cannot appear more than once in a document
>> - something else?
>
> What I'm trying to say (evidently not very well yet!) is that you can't
> have a operation object with "add" and "remove" at the same time. Only
> one operation member per operation object.

ok, so this is probably just a "vocabulary" detail. "operation",
"operation object", "operation member" maybe a glossary or just some
simple oneline definitions up front can help clear that up.

>
>> possibly consider adding an example of a document that should be
>> rejected as it is malformed.
>
> Will do, thanks.
cool.

>
>> Sec #5 Error Handling
>> "In the event of an error condition, evaluation of the JSON Patch
>> document terminates and modification of the target document fails to
>> complete."
>>
>> Does this mean the server should treat the document as an
>> "all-or-nothing" case? when an error occurs is the document left in a
>> "partial state" or left at the "initial state" before the request? is
>> this something you want to detail in the spec? if yes, you might want
>> to use RFC 2119 words here (MAY, SHOULD, MUST, etc.) .
>
> HTTP PATCH is clear on the semantics, namely, "If the entire patch
> document cannot be successfully applied, then the server MUST NOT apply
> any of the changes." I've left this out of my spec, but I think there's
> no good reason not to be clearer by saying application of a sequence of
> patches SHOULD be atomic. Implementations are free to be even stricter
> with a MUST of their own, as HTTP PATCH is. Thoughts?

yep, the PATCH semantics are clear on that and it's a good idea to
stick with them. I'd proly reference those semantics in the I-D then.
either in the error handling section or possibly in another area of
the I-D.


>
>> It looks like your operations account for an error condition at the
>> individual "node" level:
>> "It is an error condition if the value to be replaced does not exist.", etc.
>
> Indeed.
>
>> Are there error conditions that might occur at the "document" level
>> (or some other node above the target?
>>
>> You do not indicate any use of 4xx codes here (i.e. mapping 4xx codes
>> to common error conditions in processing the patch); is this something
>> you want to include here or leave that up to the server to decide?
>
> Since JSON Patch is not specific to HTTP, I'm content to defer to HTTP
> PATCH and HTTP specifications, which amply document how to handle
> situations such as when one attempts to apply an HTTP PATCH against a
> resource that does not exist.

ok, i can see that. however, you've outline some error conditions in
your document. do you have any plans to indicate servers
[MUST|SHOULD|MAY] return the details of the errors encountered
("member to be added in the object already exists", "the specified
index is greater than the number of elements in the existing array",
etc.) and if yes, any suggestions on what the response would look
like? I'm not sure this is needed (maybe you want to leave all that to
implementors), but wanted to ask about it here.

Mike

>
> Thanks again!
>
> Paul
>
> _______________________________________________
> ietf-types mailing list
> ietf-types@ietf.org
> https://www.ietf.org/mailman/listinfo/ietf-types
>