Re: [Json] On flat vs nested JSON encoding style

Anders Rundgren <anders.rundgren.net@gmail.com> Fri, 05 February 2016 06:23 UTC

Return-Path: <anders.rundgren.net@gmail.com>
X-Original-To: json@ietfa.amsl.com
Delivered-To: json@ietfa.amsl.com
Received: from localhost (ietfa.amsl.com [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id C62D01B3658 for <json@ietfa.amsl.com>; Thu, 4 Feb 2016 22:23:35 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2
X-Spam-Level:
X-Spam-Status: No, score=-2 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_FROM=0.001, SPF_PASS=-0.001] autolearn=ham
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id dzpzIGWi6DT9 for <json@ietfa.amsl.com>; Thu, 4 Feb 2016 22:23:34 -0800 (PST)
Received: from mail-wm0-x236.google.com (mail-wm0-x236.google.com [IPv6:2a00:1450:400c:c09::236]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id EE92C1B3657 for <json@ietf.org>; Thu, 4 Feb 2016 22:23:33 -0800 (PST)
Received: by mail-wm0-x236.google.com with SMTP id 128so56956021wmz.1 for <json@ietf.org>; Thu, 04 Feb 2016 22:23:33 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-type:content-transfer-encoding; bh=pfQ47WiLLw2qa0Tn254nf9RkUhbJ91vEixroqLpwJns=; b=XikGoraWVAajBB4bspsRyG+7oYD8M85nJUF68pvMrm2X/z9jVW995SKk4oo62xpQEM VYkU5utBy6sRshJj6K9m+UgAcwe6D4rayjiuFCXD9uGGi/ijxVQp4UDj4JtOdW0slboO sy4fWSLqLI0mTwFIGBYpIzI7uBX+EFK9y7kGMZ+t8X/QOi10p8NapkZiiL0odvYnKq// 54B/KRyvYTCRUj/39xRBuFOPXbCjXcooqHzxaJnBeSwwsjjAhp9Eeib0tqZ+8N8Jv83X kUYet0O1wgMPUSnxO0T/r8+spiu3XQn8xlOy2/J6FzCDjhB7+Fm8iD5TPR+SbUUTMi5h 4k/A==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-type :content-transfer-encoding; bh=pfQ47WiLLw2qa0Tn254nf9RkUhbJ91vEixroqLpwJns=; b=BTXwKem8BcczyRghhZdFKWOS7h4FA3dB3+SYZeVbUXTyxQ9QRMeaIRlxU3bcxaxK4C vng3EpDIluozaLFsMa5efnfw20o8Z1hdKrhj78/Bd8Y4tJLZeFrBrAuNQQ69uLzhxkB3 N1ZizjfcMfdgr+XR5Kc7FMRKzMyfLDAUqve2RARolxqajJPYZPP3FSD9zOHnnb+Urt4e BtCNsWecE8Tk3I8iKH0FCx5OeRuhqIHH1wAtULswb92lRUcscIlbMXaWCp0E9kHQ6VVt /0TMgvuZTvy12PucInsdlUrs3NUG2ExhsfomImp4T6dE4WqNsOCjwN+4BvF9X0N732Su 9edA==
X-Gm-Message-State: AG10YOTKus7mg3NnnncaZqXadIoNoq4VkiugiY17m/jSkzVXSgabc3TTn/uQ5FOYMjztvw==
X-Received: by 10.194.21.101 with SMTP id u5mr14076174wje.53.1454653412569; Thu, 04 Feb 2016 22:23:32 -0800 (PST)
Received: from [192.168.1.79] (9.197.130.77.rev.sfr.net. [77.130.197.9]) by smtp.googlemail.com with ESMTPSA id w136sm29394100wmw.0.2016.02.04.22.23.31 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 04 Feb 2016 22:23:31 -0800 (PST)
To: Phillip Hallam-Baker <phill@hallambaker.com>, John Cowan <cowan@mercury.ccil.org>
References: <CAMm+LwirhVcmUkdfyA3WKe_W747JTWNF1Ht2Nr8NJdDxOFCJOw@mail.gmail.com> <56B36D15.1030306@gmail.com> <56B370A1.1050508@tzi.org> <56B373B8.7040305@gmail.com> <20160205001717.GC2997@mercury.ccil.org> <CAMm+Lwg4iqKtUjX+gw2zMu6A-fRc7_MRT14R3n670gBzMtdP9Q@mail.gmail.com>
From: Anders Rundgren <anders.rundgren.net@gmail.com>
Message-ID: <56B43FCE.6080408@gmail.com>
Date: Fri, 5 Feb 2016 07:23:10 +0100
User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1
MIME-Version: 1.0
In-Reply-To: <CAMm+Lwg4iqKtUjX+gw2zMu6A-fRc7_MRT14R3n670gBzMtdP9Q@mail.gmail.com>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
Archived-At: <http://mailarchive.ietf.org/arch/msg/json/0wmW_GTMYm900NmltJQfBFQt8uI>
Cc: Carsten Bormann <cabo@tzi.org>, JSON WG <json@ietf.org>
Subject: Re: [Json] On flat vs nested JSON encoding style
X-BeenThere: json@ietf.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: "JavaScript Object Notation \(JSON\) WG mailing list" <json.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/json>, <mailto:json-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/json/>
List-Post: <mailto:json@ietf.org>
List-Help: <mailto:json-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/json>, <mailto:json-request@ietf.org?subject=subscribe>
X-List-Received-Date: Fri, 05 Feb 2016 06:23:35 -0000

On 2016-02-05 02:09, Phillip Hallam-Baker wrote:
> On Thu, Feb 4, 2016 at 7:17 PM, John Cowan <cowan@mercury.ccil.org>; wrote:
>> Anders Rundgren scripsit:
>>
>>> This ecosystem is rapidly diminishing since ECMAScript nowadays mandates
>>> strict insertion/declaration order for serialization.
>>
>> That affects only ECMAscript implementations, though, so there are no such
>> guarantees on the server side, or server-to-server, unless Node.js or
>> something similar is being used.
>
> +1
>
> We are doing RFC7159 JSON. Order is not guaranteed. A sender can emit
> the request in any order they like. Code that depends on the order of
> elements within an object is broken.

Well, the W3C Web Payment IG/WG folks who claim they are working with
a new (and presumable secure) system for the Web Payments have not yet
begun dealing with how they are going to sign their JSON messages.

This will be a litmus test, not for RFC7159, but for RFC7515:
https://github.com/golang/go/issues/14135#issuecomment-177265555

In the meantime, I'm helping JSON tool-vendors providing support for
"Predictable Serialization" a la ES6/V8.  With the sole exception of
"Number", this is not rocket science and that particular rocket has already
been built by Google and the blueprints are readily available as well.

Maybe we can come back to this issue in 18 months and see where it went?

Anders