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

1785Re: JSON Patch Internet-Draft 02

Expand Messages
  • Ted
    Dec 1, 2011
    • 0 Attachment
      Sorry, messed up the patch portion a little bit. It should be this instead:
      patch:
      [
      { "add": "/obj", "value": {} },
      { "add": "/obj/bool", "value": true },
      { "add": "/obj/int", "value": 123 },
      { "add": "/obj/dec", "value": 123.12 },
      { "add": "/arr", "value": [] },
      { "add": "/arr/0", "value": "x" }
      ]


      --- In json@yahoogroups.com, Ted Elliott <elliott.ted@...> 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]
      >
    • Show all 4 messages in this topic