Subject: [apps-discuss] merge-patch: more examples

From: "Manger, James H" <[email-masked]>
Date: Tue, 21 May 2013 23:50:20 +1000

The list of test cases in draft-ietf-appsawg-json-merge-patch is a great addition.

A couple more would be worthwhile to illustrate some less intuitive cases:

   ORIGINAL     PATCH                       RESULT
   ----------   -------------------------   ----------------

1. {"e":null}   {"a":1}                     {"e":null,"a":1}

2. {}           {"a":{"bb":{"ccc":null}}}   {"a":{"bb":{}}}

1. shows that a field not mentioned in a patch (eg "e") is unchanged, even when it has a null value.

2. shows that a patch that superficially appears only to be removing a nested field (eg "ccc") can actually create the parent objects on the way to that nested field.

P.S. It might make the examples a bit more readable if "a", "b", "c" where only used as field names, not values (eg {"a":1} instead of {"a":"b"}). It might also be a bit more readable if the same field always had the same value in the original column (eg "a":1, "b":2, "c":[3,1,4], "d":{"dd":{"ddd":4}}, "e":null). 

--
James Manger

---

From: James M Snell <[email-masked]>
Date: Tue, 21 May 2013 08:04:14 -0700

Good suggestions. I can make these changes in the next iteration, or,
if you're so inclined, feel free to submit a pull request against the
github repo [1]

[1] https://github.com/jasnell/specs/tree/master/mature

- James

---

From: Steve Klabnik <[email-masked]>
Date: Tue, 21 May 2013 08:35:39 -0700

It might also be nice to make an analogue to
https://github.com/json-patch/json-patch-tests

---

From: James M Snell <[email-masked]>
Date: Tue, 21 May 2013 09:14:14 -0700

Agreed. The example test cases in the spec are intended to help
bootstrap such an effort. If you'd like to get a repo set up, or,
perhaps, if Mark would be willing to let us expand the existing repo
to deal with merge-patch tests, I'll contribute whatever test casesI
can.

---

From: Mark Nottingham <[email-masked]>
Date: Thu, 30 May 2013 19:07:30 +1000

Whatever makes sense; do you want a new repo under json-patch, or...?

Cheers,

On 22/05/2013, at 2:14 AM, James M Snell <[email-masked]> wrote:

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

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

---

From: James M Snell <[email-masked]>
Date: Thu, 30 May 2013 09:01:22 -0700

New repo would likely be good.