Re: [apps-discuss] draft-pbryan-json-patch-04 - comments

Julian Reschke <julian.reschke@gmx.de> Wed, 21 March 2012 17:06 UTC

Return-Path: <julian.reschke@gmx.de>
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 3C48421F85EA for <apps-discuss@ietfa.amsl.com>; Wed, 21 Mar 2012 10:06:52 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -103.47
X-Spam-Level:
X-Spam-Status: No, score=-103.47 tagged_above=-999 required=5 tests=[AWL=-0.871, BAYES_00=-2.599, USER_IN_WHITELIST=-100]
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 fAb+ksIwN5Om for <apps-discuss@ietfa.amsl.com>; Wed, 21 Mar 2012 10:06:51 -0700 (PDT)
Received: from mailout-de.gmx.net (mailout-de.gmx.net [213.165.64.22]) by ietfa.amsl.com (Postfix) with SMTP id 4505B21F85E5 for <apps-discuss@ietf.org>; Wed, 21 Mar 2012 10:06:51 -0700 (PDT)
Received: (qmail invoked by alias); 21 Mar 2012 17:06:50 -0000
Received: from p57A6E199.dip.t-dialin.net (EHLO [192.168.178.36]) [87.166.225.153] by mail.gmx.net (mp032) with SMTP; 21 Mar 2012 18:06:50 +0100
X-Authenticated: #1915285
X-Provags-ID: V01U2FsdGVkX1/UYSEOEYrU4Ybt8O7s01xlz5hgQ6xKBcXDGqw3tb dcNKVp2uvoNFb4
Message-ID: <4F6A0AA8.70106@gmx.de>
Date: Wed, 21 Mar 2012 18:06:48 +0100
From: Julian Reschke <julian.reschke@gmx.de>
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:10.0.2) Gecko/20120216 Thunderbird/10.0.2
MIME-Version: 1.0
To: Mike Acar <macar@cloudmark.com>
References: <9F0A2492-AE7D-4C12-8BB0-13489FD7F6C1@gmail.com> <1331271383.6504.1.camel@neutron> <4F5E6255.9040402@cloudmark.com> <1331651889.3301.5.camel@neutron> <4F6914D7.5050505@cloudmark.com> <4F697867.2050500@gmx.de> <4F6A0985.8030208@cloudmark.com>
In-Reply-To: <4F6A0985.8030208@cloudmark.com>
Content-Type: text/plain; charset="ISO-8859-1"; format="flowed"
Content-Transfer-Encoding: 7bit
X-Y-GMX-Trusted: 0
Cc: apps-discuss@ietf.org
Subject: Re: [apps-discuss] draft-pbryan-json-patch-04 - comments
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: Wed, 21 Mar 2012 17:06:52 -0000

On 2012-03-21 18:01, Mike Acar wrote:
> On 03/20/2012 11:42 PM, Julian Reschke wrote:
>
>> What makes you think it's optional?
>
> I don't see anything in the spec that requires a test operation in a
> patch. So this conforms:
>
> [
> { "add": "/a/b/c", "value": [ "foo", "bar" ] },
> { "remove": "/foo/bar/baz" }
> ]
>
> Similarly, this conforms:
>
> [
> { "add": "/a/b/c", "value": [ "foo", "bar" ] },
> { "test": "/a/b/c", "value": [ "foo", "bar" ] }
> ]
>
> Whether those patch docs make any sense is a question of a particular
> use case.

4.6. test


    The "test" operation tests that a value at the specified location in
    the target document is equal to a specified value.  The operation
    object contains a "value" member, which specifies the value to test
    for.  If values are or contain objects or arrays, they must be
    identical (i.e. same order of elements, with the same values).

    Example:

    { "test": "/a/b/c", "value": "foo" }

    It is an error condition if the value at the specified location is
    not equal to the specified value.

Note the last paragraph.

Best regards, Julian