Loading ...
Sorry, an error occurred while loading the content.

1786Re: [json] Re: JSON Patch Internet-Draft 02

Expand Messages
  • Paul C. Bryan
    Dec 3, 2011
    • 0 Attachment
      It supports any value type, including objects and arrays.

      Paul

      On Thu, 2011-12-01 at 09:05 -0500, Ted Elliott wrote:

      >
      >
      > Does the value type have to be a string, or does it support the other
      > types, e.g. true/false, numbers, objects, arrays, etc. I believe it
      > should
      > be any valid json. Otherwise it's of limited usefulness. Some
      > examples:
      >
      > original document:
      > {
      > "foo": "bar"
      > }
      >
      > patch:
      > [
      > { "add": "/foo/obj", "value": {} },
      > { "add": "/foo/obj/bool", "value": true },
      > { "add": "/foo/obj/int", "value": 123 },
      > { "add": "/foo/obj/dec", "value": 123.12 },
      > { "add": "/foo/arr", "value": [] },
      > { "add": "/foo/arr/0", "value": "x" }
      > ]
      >
      > resulting document:
      > {
      > "foo": "bar",
      > "obj": {
      > "bool" : true,
      > "int": 123,
      > "dec": 123.12
      > },
      > "arr": [ "x" ]
      > }
      >
      > [Non-text portions of this message have been removed]
      >
      >
      >
      >
      >



      [Non-text portions of this message have been removed]
    • Show all 4 messages in this topic