Re: [apps-discuss] draft-snell-merge-patch-08 in Ruby

"Manger, James H" <James.H.Manger@team.telstra.com> Mon, 20 May 2013 00:14 UTC

Return-Path: <James.H.Manger@team.telstra.com>
X-Original-To: apps-discuss@ietfa.amsl.com
Delivered-To: apps-discuss@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 917F721F8C20 for <apps-discuss@ietfa.amsl.com>; Sun, 19 May 2013 17:14:59 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -0.251
X-Spam-Level:
X-Spam-Status: No, score=-0.251 tagged_above=-999 required=5 tests=[AWL=0.650, BAYES_00=-2.599, HELO_EQ_AU=0.377, HOST_EQ_AU=0.327, RELAY_IS_203=0.994]
Received: from mail.ietf.org ([12.22.58.30]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id w97hoQfQvnDZ for <apps-discuss@ietfa.amsl.com>; Sun, 19 May 2013 17:14:54 -0700 (PDT)
Received: from ipxavo.tcif.telstra.com.au (ipxavo.tcif.telstra.com.au [203.35.135.200]) by ietfa.amsl.com (Postfix) with ESMTP id 8169821F89A6 for <apps-discuss@ietf.org>; Sun, 19 May 2013 17:14:53 -0700 (PDT)
X-IronPort-AV: E=Sophos;i="4.87,704,1363093200"; d="scan'208";a="136049148"
Received: from unknown (HELO ipccvi.tcif.telstra.com.au) ([10.97.217.208]) by ipoavi.tcif.telstra.com.au with ESMTP; 20 May 2013 10:14:50 +1000
X-IronPort-AV: E=McAfee;i="5400,1158,7080"; a="132976345"
Received: from wsmsg3704.srv.dir.telstra.com ([172.49.40.197]) by ipccvi.tcif.telstra.com.au with ESMTP; 20 May 2013 10:14:50 +1000
Received: from WSMSG3153V.srv.dir.telstra.com ([172.49.40.159]) by WSMSG3704.srv.dir.telstra.com ([172.49.40.197]) with mapi; Mon, 20 May 2013 10:14:50 +1000
From: "Manger, James H" <James.H.Manger@team.telstra.com>
To: Steve Klabnik <steve@steveklabnik.com>, "apps-discuss@ietf.org" <apps-discuss@ietf.org>
Date: Mon, 20 May 2013 10:14:49 +1000
Thread-Topic: [apps-discuss] draft-snell-merge-patch-08 in Ruby
Thread-Index: Ac5UAhFIXJcSYseqTVCf4MFuV19C6wA5j60g
Message-ID: <255B9BB34FB7D647A506DC292726F6E1151A34C59E@WSMSG3153V.srv.dir.telstra.com>
References: <CABL+ZB6AQGp8WUeH=HZrfm4VCQnmYFQB5vBGP0yghAZUhsjCQg@mail.gmail.com>
In-Reply-To: <CABL+ZB6AQGp8WUeH=HZrfm4VCQnmYFQB5vBGP0yghAZUhsjCQg@mail.gmail.com>
Accept-Language: en-US, en-AU
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
acceptlanguage: en-US, en-AU
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: base64
MIME-Version: 1.0
Subject: Re: [apps-discuss] draft-snell-merge-patch-08 in Ruby
X-BeenThere: apps-discuss@ietf.org
X-Mailman-Version: 2.1.12
Precedence: list
List-Id: General discussion of application-layer protocols <apps-discuss.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/apps-discuss>, <mailto:apps-discuss-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/apps-discuss>
List-Post: <mailto:apps-discuss@ietf.org>
List-Help: <mailto:apps-discuss-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/apps-discuss>, <mailto:apps-discuss-request@ietf.org?subject=subscribe>
X-List-Received-Date: Mon, 20 May 2013 00:14:59 -0000

Steve,

It is good to hear about a Ruby json-merge-patch. There are a couple of cases where I think draft-snell-merge-patch gets it wrong, example of which are tabulated at http://id.cto.telstra.com/json/merge.html. I would be interested to know what your implementation does in these cases?

Document + patch = ?

[1,2]  +  {"a":"foo","b":null}

{"a":"foo"}  +  {"b":[3,null,{"x":null}]}

{"a":"foo"}  +  null

--
James Manger

> ----------
> From: apps-discuss-bounces@ietf.org [mailto:apps-discuss-
> bounces@ietf.org] On Behalf Of Steve Klabnik
> Sent: Sunday, 19 May 2013 5:58 AM
> 
> Hey there!
> 
> James suggested that I post to this list, so here I am.
> 
> I'm a committer to Ruby on Rails, and Rails 4 is near a release. One
> of the changes in Rails 4 is the usage of PATCH, which means I'm
> checking up on various diff media types. Mark Nottingham brought my
> attention to draft-snell-merge-patch as a simpler variant of
> json-patch.
> 
> Anyway, I have a _mostly_ working implementation of the latest draft
> as a gem, here: https://github.com/steveklabnik/json-merge_patch .
> It's only missing the "Recursively apply rule 2" portion. Hopefully
> I'll be finishing it off soon.
> 
> I'd say that overall this draft was super simple to implement,
> especially given Ruby's (like many scripting languages) ease of
> mapping JSON directly to its rich Hash and Array types in the language
> core.
> 
> I may have one or two thoughts on the language of the spec, but I need
> to re-read it and take some notes this time around.