Re: [apps-discuss] Last Call: <draft-ietf-appsawg-json-patch-08.txt> (JSON Patch) to Proposed Standard

"Paul C. Bryan" <pbryan@anode.ca> Tue, 11 December 2012 17:41 UTC

Return-Path: <pbryan@anode.ca>
X-Original-To: ietf@ietfa.amsl.com
Delivered-To: ietf@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 169DF21F885D; Tue, 11 Dec 2012 09:41:43 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.598
X-Spam-Level:
X-Spam-Status: No, score=-2.598 tagged_above=-999 required=5 tests=[BAYES_00=-2.599, HTML_MESSAGE=0.001]
Received: from mail.ietf.org ([64.170.98.30]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id jjUylC-gNjwW; Tue, 11 Dec 2012 09:41:42 -0800 (PST)
Received: from maple.anode.ca (maple.anode.ca [72.14.183.184]) by ietfa.amsl.com (Postfix) with ESMTP id 4F49B21F8816; Tue, 11 Dec 2012 09:41:42 -0800 (PST)
Received: from [10.126.22.61] (nat-204-14-239-210-sfo.net.salesforce.com [204.14.239.210]) by maple.anode.ca (Postfix) with ESMTPSA id 7D1C46450; Tue, 11 Dec 2012 17:41:41 +0000 (UTC)
Subject: Re: [apps-discuss] Last Call: <draft-ietf-appsawg-json-patch-08.txt> (JSON Patch) to Proposed Standard
From: "Paul C. Bryan" <pbryan@anode.ca>
To: James M Snell <jasnell@gmail.com>
In-Reply-To: <CABP7RbfnfMxEUna=snZHHhFkgorxCM+uTXL69RMriyLo-A6qig@mail.gmail.com>
References: <20121211150005.28209.96763.idtracker@ietfa.amsl.com> <CAC4RtVBNxQu03hZxFZiRg-7s2G_KYKFJjUUvSC_UUFwE_FZFdg@mail.gmail.com> <CABP7RbfnfMxEUna=snZHHhFkgorxCM+uTXL69RMriyLo-A6qig@mail.gmail.com>
Content-Type: multipart/alternative; boundary="=-Qp5FcYlekSffU306EFPn"
Date: Tue, 11 Dec 2012 09:41:40 -0800
Message-ID: <1355247700.17722.59.camel@pbryan-wsl.internal.salesforce.com>
Mime-Version: 1.0
X-Mailer: Evolution 2.28.3
X-Mailman-Approved-At: Wed, 12 Dec 2012 10:26:48 -0800
Cc: Barry Leiba <barryleiba@computer.org>, IETF discussion list <ietf@ietf.org>, "apps-discuss@ietf.org" <apps-discuss@ietf.org>
X-BeenThere: ietf@ietf.org
X-Mailman-Version: 2.1.12
Precedence: list
List-Id: IETF-Discussion <ietf.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/ietf>, <mailto:ietf-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/ietf>
List-Post: <mailto:ietf@ietf.org>
List-Help: <mailto:ietf-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/ietf>, <mailto:ietf-request@ietf.org?subject=subscribe>
X-List-Received-Date: Tue, 11 Dec 2012 17:41:43 -0000

I'm not fond of that decision either.

Paul

On Tue, 2012-12-11 at 09:22 -0800, James M Snell wrote:

> You are reading it correctly. Note also that the very next bullet
> point says: 
> 
> 
> 
>   A member to add to an existing object - whereupon the supplied
>   value is added to that object at the indicated location.  If the
>   member already exists, it is replaced by the specified value.
> 
> 
> So an "add" is really a "replace" that does not have the "target
> location MUST exist" restriction. Personally, I'm not too fond of that
> decision. For anything other than an array, "add" should fail if the
> target already exists. For arrays, "add" should insert but never
> replace an existing value. 
> 
> 
> - James
> 
> 
> 
> On Tue, Dec 11, 2012 at 7:25 AM, Barry Leiba <barryleiba@computer.org>
> wrote:
> 
>         > Abstract
>         >    JSON Patch defines the media type
>         "application/json-patch", a JSON
>         >    document structure for expressing a sequence of
>         operations to apply
>         >    to a JSON document, suitable for use with the HTTP PATCH
>         method.
>         
>         
>         ...
>         >
>         http://datatracker.ietf.org/doc/draft-ietf-appsawg-json-patch/
>         
>         I've reviewed JSON Patch and JSON Pointer as responsible AD,
>         and am
>         very happy with the documents -- this is good work, well
>         written.  I
>         came up with one issue that I want to discuss as part of last
>         call:
>         
>            4.1.  add
>         
>            The "add" operation adds a new value at the target
>         location.  The
>            operation object MUST contain a "value" member that
>         specifies the
>            value to be added.
>         
>            For example:
>         
>            { "op": "add", "path": "/a/b/c", "value": [ "foo",
>         "bar" ] }
>         
>            When the operation is applied, the target location MUST
>         reference one
>            of:
>         
>            o  The root of the target document - whereupon the
>         specified value
>               becomes the entire content of the target document.
>         
>         Now, what this means is that if we start with this:
>         
>         { "a": { "num": 1 } }
>         
>         and we apply this:
>         
>         { "op": "add", "path": "", "value": [ "foo", "bar" ] }
>         
>         we end up with this:
>         
>         [ "foo", "bar" ]
>         
>         This doesn't strike me as having any sense of an "add"
>         operation -- it
>         appears to be a special case that doesn't fit.  In any other
>         situation, using any other path, the operation either adds
>         something
>         to what's already there, or it fails.  But when the path is
>         "", it's
>         anomalous.
>         
>         So, three questions:
>         
>         1. Do I have this right, or am I mistaken about the result of
>         that operation?
>         
>         2. Assuming I have it right, can someone explain why it's this
>         way?
>         
>         3. Can someone explain why this is the right way to specify
>         it, rather
>         than using "replace" for this?
>         
>         Barry
>         
>         _______________________________________________
>         apps-discuss mailing list
>         apps-discuss@ietf.org
>         https://www.ietf.org/mailman/listinfo/apps-discuss
>         
> 
> 
> 
> 
> _______________________________________________
> apps-discuss mailing list
> apps-discuss@ietf.org
> https://www.ietf.org/mailman/listinfo/apps-discuss