Re: [apps-discuss] JSON Patch: jsondiff and syntax

"Roy T. Fielding" <> Sun, 11 December 2011 23:03 UTC

Return-Path: <>
Received: from localhost (localhost []) by (Postfix) with ESMTP id 7620121F84A1 for <>; Sun, 11 Dec 2011 15:03:08 -0800 (PST)
X-Virus-Scanned: amavisd-new at
X-Spam-Flag: NO
X-Spam-Score: -106.599
X-Spam-Status: No, score=-106.599 tagged_above=-999 required=5 tests=[AWL=-4.000, BAYES_00=-2.599, USER_IN_WHITELIST=-100]
Received: from ([]) by localhost ( []) (amavisd-new, port 10024) with ESMTP id QsGp0bfQUET7 for <>; Sun, 11 Dec 2011 15:03:07 -0800 (PST)
Received: from ( []) by (Postfix) with ESMTP id BB96221F848F for <>; Sun, 11 Dec 2011 15:03:07 -0800 (PST)
Received: from (localhost []) by (Postfix) with ESMTP id 4C2C2BC041; Sun, 11 Dec 2011 15:03:07 -0800 (PST)
DomainKey-Signature: a=rsa-sha1; c=nofws;; h=subject:mime-version :content-type:from:in-reply-to:date:cc:content-transfer-encoding :message-id:references:to; q=dns;; b=WCByKD0UkiB7hxo8 KvSkhHLDUrQmWefUsgxMTmJ8Vm9gxNVYALmE61cyS2I7BUON+DLmMwzJPngsLapd 9oYAJ3rSZnwgfZmHOgxHdO7lpDwAW9fv1vhXN/sXlIqSiHKzKKer8vtM7CdC08W3 VbPX7TU6sIkdmLST44+DD1diyc8=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed;; h=subject :mime-version:content-type:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to;; bh=KcOrkzdKVsNDK2Thpd6kZA+5lLM=; b=ZvR0e4awlwgHzpVDUzYf/xlgg0CI +cXeNv9MRE9bOHRRbC2mg9TMQ9+MupZ9QCY1/8oDdnLLbmmiVKQ3sy2swtHdvrZ9 i+K0NmAGozN4mwI+BXTQVFuZKilq1PgbekI6xif6R1vnkTNa3KTGhsPBRz/GZn+D peZfL7dpEyaZaFo=
Received: from [] ( []) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: by (Postfix) with ESMTPSA id 33F71BC040; Sun, 11 Dec 2011 15:03:07 -0800 (PST)
Mime-Version: 1.0 (Apple Message framework v1251.1)
Content-Type: text/plain; charset=us-ascii
From: "Roy T. Fielding" <>
In-Reply-To: <>
Date: Sun, 11 Dec 2011 15:03:05 -0800
Content-Transfer-Encoding: quoted-printable
Message-Id: <>
References: <>
To: Martin Algesten <>
X-Mailer: Apple Mail (2.1251.1)
Subject: Re: [apps-discuss] JSON Patch: jsondiff and syntax
X-Mailman-Version: 2.1.12
Precedence: list
List-Id: General discussion of application-layer protocols <>
List-Unsubscribe: <>, <>
List-Archive: <>
List-Post: <>
List-Help: <>
List-Subscribe: <>, <>
X-List-Received-Date: Sun, 11 Dec 2011 23:03:08 -0000

FWIW, discussion of which format is best for a diff should really be based
on what is being compared (a file or an abstract memory structure?) and what
is expected to process the diff.

For example, JSOP has a diff format

that should be evaluated based on comparing JCR repository trees and an
understanding that the main processor is going to be a server-side patch
implementation.  Given that context, our JSON represents a state of the
JCR repository: the actual diff format does not need to be JSON because
it won't be processed by a browser (only generated by XHR).

I happen to agree that choosing any verbose diff format is a non-starter,
even if we assume compression, though I have a hard time evaluating a
JSON diff proposal without a more concrete notion of what it is intended
to do and why anyone would want to use it.


On Dec 10, 2011, at 7:05 PM, Martin Algesten wrote:

> (Sorry Paul C. Bryan, I'm stalking you from list to list. ;)
> This is in reference to a discussion from a couple of days back 
> Parallel to Paul's work I've dreamt up another JSON patch syntax and implemented a diff/patch tool here:
> I don't agree that the verbosity of the JSON Patch RFC ( is okay.
> I believe one of the big reasons that JSON has gained such popularity over say XML, is the simplicity of it. The simplicity is gained by a loss of semantics or perhaps better call it "inferred" semantics. Such inference are even more obvious in other terse data exchange formats such as YAML.
> JSON Patch goes against this by having very explicit verbs "add", "replace", "move" etc. I don't buy the argument that using gzip transfer encoding solves this. XML compresses amazingly well, but I rather see that as an argument that something is wrong in the format to start off with.
> I also think about things like "diff -u" where the '+/-' becomes second nature and the patches are very readable. Currently a JSON Patch file is an instruction list of mutations - almost like a programming language, which for me is different to a diff. But then I'm clearly biased :)
> Cheers,
> Martin
> _______________________________________________
> apps-discuss mailing list