Re: [apps-discuss] JSON Patch

Martin Thomson <martin.thomson@gmail.com> Thu, 24 November 2011 02:03 UTC

Return-Path: <martin.thomson@gmail.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 19D6311E8098 for <apps-discuss@ietfa.amsl.com>; Wed, 23 Nov 2011 18:03:09 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -3.599
X-Spam-Level:
X-Spam-Status: No, score=-3.599 tagged_above=-999 required=5 tests=[BAYES_00=-2.599, 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 kL8iacsRUtYB for <apps-discuss@ietfa.amsl.com>; Wed, 23 Nov 2011 18:03:08 -0800 (PST)
Received: from mail-bw0-f44.google.com (mail-bw0-f44.google.com [209.85.214.44]) by ietfa.amsl.com (Postfix) with ESMTP id C137D11E80B5 for <apps-discuss@ietf.org>; Wed, 23 Nov 2011 18:03:07 -0800 (PST)
Received: by bkbzv15 with SMTP id zv15so2182323bkb.31 for <apps-discuss@ietf.org>; Wed, 23 Nov 2011 18:03:06 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=S6Dyjs8LVbGyOlxtHlX/KLxkXDeAHH3N6VhpRyhHru8=; b=e3gsqcWEwslm+LzDZAPbEn85T9qMdcYj2eDtDCkay3dfkmgTTwZlEJ/Yiw7wxnrTB0 4arSUQjFMMMUDXHJH9CwNlR4+KGstS8JJBResxBBWX1CVGQ6IUK7jG8TLiYG6DeYAwAu hO5z/VtWc0L67NogyXVHRPqXesp/2WeceYlp4=
MIME-Version: 1.0
Received: by 10.204.152.4 with SMTP id e4mr26345085bkw.56.1322100186762; Wed, 23 Nov 2011 18:03:06 -0800 (PST)
Received: by 10.204.72.210 with HTTP; Wed, 23 Nov 2011 18:03:06 -0800 (PST)
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>
Date: Thu, 24 Nov 2011 13:03:06 +1100
Message-ID: <CABkgnnUCbMR3YOSu8dBPnrLSukBjMsiCh_rex6ojLc-UgH86OQ@mail.gmail.com>
From: Martin Thomson <martin.thomson@gmail.com>
To: Julian Reschke <julian.reschke@gmx.de>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
Cc: apps-discuss@ietf.org
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: Thu, 24 Nov 2011 02:03:09 -0000

On 23 November 2011 03:05, Julian Reschke <julian.reschke@gmx.de> wrote:
>   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".
>   A JSON Patch document:
>
>   [
>       { "move": "/foo/1", "to": 2}
>   ]

A thought occurred.  What about this?

[
  { "move" : "/foo/1", "to": "/foo/2" }
]

And allow for movement anywhere in the document.