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

"Paul C. Bryan" <paul.bryan@forgerock.com> Mon, 24 October 2011 23:35 UTC

Return-Path: <paul.bryan@forgerock.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 A671111E81EC for <ietf-types@ietfa.amsl.com>; Mon, 24 Oct 2011 16:35:16 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -6.599
X-Spam-Level:
X-Spam-Status: No, score=-6.599 tagged_above=-999 required=5 tests=[AWL=0.000, BAYES_00=-2.599, 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 F5FbK30im9sI for <ietf-types@ietfa.amsl.com>; Mon, 24 Oct 2011 16:35:16 -0700 (PDT)
Received: from eu1sys200aog106.obsmtp.com (eu1sys200aog106.obsmtp.com [207.126.144.121]) by ietfa.amsl.com (Postfix) with SMTP id 741A111E80A4 for <ietf-types@ietf.org>; Mon, 24 Oct 2011 16:35:14 -0700 (PDT)
Received: from mail-gy0-f175.google.com ([209.85.160.175]) (using TLSv1) by eu1sys200aob106.postini.com ([207.126.147.11]) with SMTP; Mon, 24 Oct 2011 23:35:15 UTC
Received: by gyc15 with SMTP id 15so7813796gyc.34 for <ietf-types@ietf.org>; Mon, 24 Oct 2011 16:34:43 -0700 (PDT)
Received: by 10.68.10.3 with SMTP id e3mr51247669pbb.59.1319499283151; Mon, 24 Oct 2011 16:34:43 -0700 (PDT)
Received: from [192.168.1.8] (S0106a021b762dbb3.vf.shawcable.net. [174.1.40.184]) by mx.google.com with ESMTPS id jm5sm2232207pbc.1.2011.10.24.16.34.42 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 24 Oct 2011 16:34:42 -0700 (PDT)
Message-ID: <1319499281.2711.10.camel@neutron>
From: "Paul C. Bryan" <paul.bryan@forgerock.com>
To: ietf-types@ietf.org
Date: Mon, 24 Oct 2011 16:34:41 -0700
In-Reply-To: <CAPW_8m6XB0B68GnCNA-6D_5q5CFRj8jKpt1GftRYN640rjCCTg@mail.gmail.com>
References: <1319490143.23040.8.camel@neutron> <CAPW_8m6XB0B68GnCNA-6D_5q5CFRj8jKpt1GftRYN640rjCCTg@mail.gmail.com>
Content-Type: text/plain; charset="UTF-8"
X-Mailer: Evolution 3.0.3-2
Content-Transfer-Encoding: 7bit
Mime-Version: 1.0
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: Mon, 24 Oct 2011 23:35:16 -0000

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.

> possibly consider adding an example of a document that should be
> rejected as it is malformed.

Will do, thanks.

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

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

Thanks again!

Paul