Subject: [apps-discuss] Feedback on draft-ietf-appsawg-json-patch-02

From: Stefan Guggisberg <[email-masked]>
Date: Wed, 11 Jul 2012 14:39:13 +0200

hi,

disclaimer: i am new to the IETF and this is my first post
on this list. please forgive my ignorance if i've missed
something obvious.

here's my feedback:

4.6. test

"If values are or contain objects or arrays, they must be
 identical (i.e. same order of elements, with the same values)."

the last sentence in brackets is IMO misleading since it
only applies to arrays. for object comparison the order of
elements is irrelevant, i.e. two objects are identical if they
contain the exact same set of elements with the same values.

5.0 Error Handling

"... and application of the entire patch document SHALL
   NOT be deemed successful."

does that mean that any changes caused by preceding
successful operations within the same patch document
MUST be reverted, i.e. the application of the patch
document is always an all-or-nothing operation?

Appendix A. Examples.

all examples except for "A.6.  Moving a Value" deal
with shallow json objects. i think it would be good
to add an example for adding a nested member object,
e.g.

Adding a nested Member Object

   An example target JSON document:

   {
       "foo": "bar"
   }

   A JSON Patch document:

   [
       { "add": "/child", "value": { "grandchild": { } } }
   ]

   The resulting JSON document:

   {
       "foo": "bar",
       "child": {
           "grandchild": {
           }
       }
   }

cheers
stefan

---

From: Mark Nottingham <[email-masked]>
Date: Thu, 12 Jul 2012 10:26:28 +1000

> on this list. please forgive my ignorance if i've missed

Hi Stefan,

Welcome :)

> contain the exact same set of elements with the same values.

Good point; I've added this as <http://trac.tools.ietf.org/wg/appsawg/trac/ticket/11>.

Note that we have an open issue regarding whether we keep test - see <http://trac.tools.ietf.org/wg/appsawg/trac/ticket/7>.

> document is always an all-or-nothing operation?

PATCH requires it to be atomic; see <http://tools.ietf.org/html/rfc5789#section-2>. I've added a small note to this effect to remind people.

>   The resulting JSON document:

Thanks, I've added this to the next draft.

Regards,

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