Re: [apps-discuss] JSON Patch

"Paul C. Bryan" <paul.bryan@forgerock.com> Tue, 22 November 2011 18:25 UTC

Return-Path: <paul.bryan@forgerock.com>
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 6C11D21F8BFE for <apps-discuss@ietfa.amsl.com>; Tue, 22 Nov 2011 10:25:19 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -6.657
X-Spam-Level:
X-Spam-Status: No, score=-6.657 tagged_above=-999 required=5 tests=[AWL=-0.059, BAYES_00=-2.599, 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 pxWm0Xrdc+hv for <apps-discuss@ietfa.amsl.com>; Tue, 22 Nov 2011 10:25:18 -0800 (PST)
Received: from eu1sys200aog103.obsmtp.com (eu1sys200aog103.obsmtp.com [207.126.144.115]) by ietfa.amsl.com (Postfix) with SMTP id 45CDB21F8BEF for <apps-discuss@ietf.org>; Tue, 22 Nov 2011 10:25:18 -0800 (PST)
Received: from mail-qw0-f46.google.com ([209.85.216.46]) (using TLSv1) by eu1sys200aob103.postini.com ([207.126.147.11]) with SMTP ID DSNKTsvo/lr9ZycslNTDkdj2+HGPWDGo1+a6@postini.com; Tue, 22 Nov 2011 18:25:18 UTC
Received: by qadc14 with SMTP id c14so1932250qad.5 for <apps-discuss@ietf.org>; Tue, 22 Nov 2011 10:25:01 -0800 (PST)
Received: by 10.224.198.10 with SMTP id em10mr9023200qab.44.1321986301157; Tue, 22 Nov 2011 10:25:01 -0800 (PST)
Received: from [192.168.1.3] (S0106a021b762dbb3.vf.shawcable.net. [174.1.40.184]) by mx.google.com with ESMTPS id ff9sm14776782qab.16.2011.11.22.10.24.59 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 22 Nov 2011 10:24:59 -0800 (PST)
Message-ID: <1321986297.2091.1.camel@neutron>
From: "Paul C. Bryan" <paul.bryan@forgerock.com>
To: apps-discuss@ietf.org
Date: Tue, 22 Nov 2011 10:24:57 -0800
In-Reply-To: <4ECBC843.60900@gmx.de>
References: <4EB1482E.1040600@adobe.com> <4EB14C2E.8040208@gmx.de> <1320254564.2622.37.camel@neutron> <4EBBA0DD.9020605@gmx.de> <4ECBC843.60900@gmx.de>
Content-Type: multipart/alternative; boundary="=-kbkVB/AflXMz3dk5Dxdm"
X-Mailer: Evolution 3.0.3-2
Mime-Version: 1.0
Subject: Re: [apps-discuss] JSON Patch
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: Tue, 22 Nov 2011 18:25:19 -0000

Looks good to me. I don't think "end" is needed, as the end index can be
explicitly specified.

Paul

On Tue, 2011-11-22 at 17:05 +0100, Julian Reschke wrote:

> On 2011-11-10 11:01, Julian Reschke wrote:
> > On 2011-11-02 18:22, Paul C. Bryan wrote:
> >> Thanks everyone for the feedback so far. Some replies:
> >>
> >> On Wed, 2011-11-02 at 13:39 +0000, Michael Dürig wrote:
> >>> What is missing (wrt. to [2]) is a reorder operation.
> >>
> >> The ability to move items in an array has come up and seems
> >> straightforward. A need (and semantics) of moving a value between two
> >> arbitrary locations in a JSON document is not well understood.
> >
> > +1. So are you planning to add this? Would it make sense to make a
> > concrete proposal?
> > ...
> 
> OK, here's draft proposal:
> 
> 4.4. move
> 
>     The "move" operation moves an existing array element. The "to" 
> member indicates the array position as integer value. This operation is 
> equivalent to removing the element identified by "move", an inserting it 
> again at the position "to".
> 
> 
> Example:
> 
>     An example target JSON document:
> 
>     {
>         "foo": [ "bar", "qux", "baz" ]
>     }
> 
>     A JSON Patch document:
> 
>     [
>         { "move": "/foo/1", "to": 2}
>     ]
> 
>     The resulting JSON document:
> 
>     {
>         "foo": ["qux", "bar", "baz"]
>     }
> 
> Q: is a special case like "end" needed?
> 
> Best regards, Julian