errata logo graphic

Found 2 records.

Status: Reported (1)

RFC6902, "JavaScript Object Notation (JSON) Patch", April 2013

Source of RFC: appsawg (app)

Errata ID: 4419

Status: Reported
Type: Technical

Reported By: Brett Zamir
Date Reported: 2015-07-17

Section A.14 says:

An example target JSON document:

   {
     "/": 9,
     "~1": 10
   }

   A JSON Patch document:

   [
     {"op": "test", "path": "/~01", "value": 10}
   ]

   The resulting JSON document:

   {
     "/": 9,
     "~1": 10
   }

It should say:

Proper JSON Pointer escaping should occur when resolving
paths for application to the target document.

An example target JSON document:

   {
     "/": 9,
     "~1": 10
   }

   A JSON Patch document:

   [
     {"op": "add", "path": "/~01", "value": 11}
   ]

   The resulting JSON document:

   {
     "/": 9,
     "~1": 11
   }

Notes:

At http://tools.ietf.org/html/rfc6902#appendix-A.14 , I have a few issues:

1. Even though JSON Pointer is referenced elsewhere, I think reference ought to be made here to JSON Pointer in order to clarify what meaning "escape ordering" has here.
2. The operation indicated in this section is "test" which is not documented in its respective sections as returning any kind of document at all. I believe "add" or "replace" must have been the intended operation instead. And to make clear that the value of key "~1" would have actually been affected by such a modifying operation, the value in the result ought to differ from that in the original document.


Status: Rejected (1)

RFC6902, "JavaScript Object Notation (JSON) Patch", April 2013

Source of RFC: appsawg (app)

Errata ID: 4460

Status: Rejected
Type: Editorial

Reported By: Lucas Bickel
Date Reported: 2015-08-29
Rejected by: Barry Leiba
Date Rejected: 2015-08-29

Section 4.1 says:

   However, the object itself or an array containing it does need to
   exist, and it remains an error for that not to be the case.  For
   example, an "add" with a target location of "/a/b" starting with this
   document:

   { "a": { "foo": 1 } }

   is not an error, because "a" exists, and "b" will be added to its
   value.  It is an error in this document:

   { "q": { "bar": 2 } }

   because "a" does not exist.

It should say:

   However, the object itself or an array containing it does need to
   exist, and it remains an error for that not to be the case.  For
   example, an "add" with a target location of "/a/b" starting with this
   document:

   { "a": { "foo": 1 } }

   is not an error, because "a" exists, and "b" will be added to its
   value.  It is an error in this document:

   { "q": { "bar": 2 } }

   because "a" does not exist. Considering a target location of "/a/1"
   it should be not be an error in this document:

    { "a": [ "foo" ] }

    while the same "add" into this document will be an error:

    { "a": [ ] }

    because "/a/0" does not exist.



Notes:

Adding to an object has such a nice example that explains the error cases. I think adding to a sequential array should have one as well.

To my understanding this is already pretty clear from RFC6901, I feel it will make the spec easier to implement if we have an example right here.
--VERIFIER NOTES--
Thanks for the comment, Lucas. This is, though, not a report of an error, so as an errata report it is rejected. It is a reasonable suggestion that we should consider if a new version of the document is done. The comment is recorded in the JSON mailing list archive.


Report New Errata