Subject: [apps-discuss] I-D Action: draft-ietf-appsawg-json-patch-07.txt

From: [email-masked]
Date: Tue, 04 Dec 2012 16:42:38 -0800

A New Internet-Draft is available from the on-line Internet-Drafts directories.
 This draft is a work item of the Applications Area Working Group Working Group of the IETF.

	Title           : JSON Patch
	Author(s)       : Paul C. Bryan
                          Mark Nottingham
	Filename        : draft-ietf-appsawg-json-patch-07.txt
	Pages           : 16
	Date            : 2012-12-04

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.

The IETF datatracker status page for this draft is:
https://datatracker.ietf.org/doc/draft-ietf-appsawg-json-patch

There's also a htmlized version available at:
http://tools.ietf.org/html/draft-ietf-appsawg-json-patch-07

A diff from the previous version is available at:
http://www.ietf.org/rfcdiff?url2=draft-ietf-appsawg-json-patch-07

Internet-Drafts are also available by anonymous FTP at:
ftp://ftp.ietf.org/internet-drafts/

---

From: Mark Nottingham <[email-masked]>
Date: Wed, 5 Dec 2012 11:53:24 +1100

Fairly substantial changes based upon LC feedback; in particular, on "move" and "copy", "to" is now "from", and much of the text has been simplified.

I've also put all of the examples into the test suite:
  https://github.com/json-patch/json-patch-tests

Cheers,

On 05/12/2012, at 11:42 AM, [email-masked] wrote:

> _______________________________________________
> apps-discuss mailing list
> [email-masked]
> https://www.ietf.org/mailman/listinfo/apps-discuss

--
Mark Nottingham   http://www.mnot.net/

---

From: "Manger, James H" <[email-masked]>
Date: Wed, 5 Dec 2012 13:36:56 +1100

>   https://github.com/json-patch/json-patch-tests

<https://github.com/json-patch/json-patch-tests/blob/master/spec_tests.json>
spec_tests.json looks right.

<https://github.com/json-patch/json-patch-tests/blob/master/simplexml_tests.json>
4 of the 5 tests in simplexml_tests.json look wrong.
The tests seem to rely on some sort of automagic equivalence between a value and a 1-item array with just that value (eg between {"foo":1} and {"foo":[1]}).
Perhaps these tests are related to something other than draft-ietf-appsawg-json-patch.

<https://github.com/json-patch/json-patch-tests/blob/master/tests.json>
tests.json has some errors.

WRONG
   { "comment": "add to existing null-valued field should err",
      "doc": {"foo": null},
      "patch": [{"op": "add", "path": "/foo", "value":1}],
      "error": "'add' target already set" },
RIGHT
   { "comment": "add replaces any existing field",
      "doc": {"foo": null},
      "patch": [{"op": "add", "path": "/foo", "value":1}],
      "expected": {"foo": 1} },

WRONG
   { "doc": {"foo": 1},
      "patch": [{"op": "add", "path": "/0", "value": "bar"}],
      "error": "Array operation on object target" },
RIGHT
   { "comment": "0 can be an array index or object element name",
      "doc": {"foo": 1},
      "patch": [{"op": "add", "path": "/0", "value": "bar"}],
      "expected": {"foo": 1, "0": "bar" },

--
James Manger

---

From: Mark Nottingham <[email-masked]>
Date: Wed, 5 Dec 2012 14:06:52 +1100

Hi James,

Thanks for that. Those tests were sourced from some earlier implementations. 

I think the best way to move them forward would be to raise issues in github -- do you mind doing that?

Cheers,

---

From: Mike McCabe <[email-masked]>
Date: Tue, 04 Dec 2012 21:27:13 -0800

James -

Thanks for your comments.  Currently, json-patch-tests is out of date 
and will need review - thanks for creating the github issues.

You're right - simplexml_tests.json is for implementation-specific 
sematics that are different than json-patch.  I'll remove it.

Regards,
Mike