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

Anders Rundgren <> Thu, 04 February 2016 15:52 UTC

Return-Path: <>
Received: from localhost ( []) by (Postfix) with ESMTP id D9FDD1B31E6 for <>; Thu, 4 Feb 2016 07:52:47 -0800 (PST)
X-Virus-Scanned: amavisd-new at
X-Spam-Flag: NO
X-Spam-Score: -2
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 ([]) by localhost ( []) (amavisd-new, port 10024) with ESMTP id rxoXRn_YB2iu for <>; Thu, 4 Feb 2016 07:52:46 -0800 (PST)
Received: from ( [IPv6:2a00:1450:400c:c09::22c]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by (Postfix) with ESMTPS id 317691B31E5 for <>; Thu, 4 Feb 2016 07:52:46 -0800 (PST)
Received: by with SMTP id r129so218299762wmr.0 for <>; Thu, 04 Feb 2016 07:52:46 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;; s=20120113; h=subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-type:content-transfer-encoding; bh=pP7G62in3Rwf5uaZaZMYW9djcfSbvIeCtVwHsht/I8Q=; b=LZJ+5K0FPV8bEgBikjMCCmZ4BQF1vXhneoac8PbMVcg/aMdailURieFvYxebmXVTFa xxReH3EpyKTU5eaEmQUIpeN+GvKDgy34/RusYfVNVDPpM/AlxO6iFlSWW7FgFpxYTglB UYmxZIuIPN1qGQRa0TR+rozuZQnLa5JHH2rt7dUXJXZ0vTVaUMu2LPRSZf3ojwq9GzJM dKXDdphFkFWdmrSD3pQeMZdeWySi0kUKrVHBQHmSYXMPuiwdiWWb5p82BNVwNLxkfEzy Y0Yf1h+j502SvN6pp8ynMjn7KFIF+DsJP/IuVwAXh1i1m/qpun01s0b4hUDBQonY9HDw tfxg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;; 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=pP7G62in3Rwf5uaZaZMYW9djcfSbvIeCtVwHsht/I8Q=; b=f6O1Q/KHOTtupDhJiPXuqy8KBqtD6lNcnl2qbH7nP924q3l4+J8mW2WvYSbRc1Lo1a TRENCkKyPthJxGJ0GH9LkBHJd6/ekE3bxbl6kGwuiz+8Xsvf6rRuWi0b3xXO2sPyTH0+ BE+ten6iJs7m7QFsePRHSP6MMVxiVndBSiafJvW9+jV0hZ5FJfmfk/Fk/1ghmUUC2WPl mA9MnKI+lObETp+gMlx1uTV73qe51JMonvOkCx0JwzG2uZsrbJ9x6ypeDBGGkf1Oji+S oAnQzb4FwHrTZsSbrniHcN/utjPttqdaXNbWDECd5wFZU2OYNV2x/fqScv5pQHgZuu5Q i6mw==
X-Gm-Message-State: AG10YORh9wr99rcCcp2p1GY2LL4KcjDZy8wKdrN+OTE9ktb59AwVz4Gfdth9jsGPaQJXyg==
X-Received: by with SMTP id v188mr26601377wma.34.1454601164759; Thu, 04 Feb 2016 07:52:44 -0800 (PST)
Received: from [] ( []) by with ESMTPSA id z65sm3038622wmg.1.2016. (version=TLSv1/SSLv3 cipher=OTHER); Thu, 04 Feb 2016 07:52:44 -0800 (PST)
To: Carsten Bormann <>
References: <> <> <>
From: Anders Rundgren <>
Message-ID: <>
Date: Thu, 4 Feb 2016 16:52:24 +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: <>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
Archived-At: <>
Cc: Phillip Hallam-Baker <>, JSON WG <>
Subject: Re: [Json] On flat vs nested JSON encoding style
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: "JavaScript Object Notation \(JSON\) WG mailing list" <>
List-Unsubscribe: <>, <>
List-Archive: <>
List-Post: <>
List-Help: <>
List-Subscribe: <>, <>
X-List-Received-Date: Thu, 04 Feb 2016 15:52:48 -0000

On 2016-02-04 16:39, Carsten Bormann wrote:

> Requiring the encoder to send data in a particular sequence is
> theoretically possible, but in practice just means you lose that part of
> the ecosystem that happens not to do that

This ecosystem is rapidly diminishing since ECMAScript nowadays mandates
strict insertion/declaration order for serialization.

In addition, if you deal with signed data like specified by JWS, don't you
anyway lose the ability to do smart sequential processing?

That is, there are undoubtedly a bunch of applications where a nested scheme
like proposed by PHB is the wat to go, but claiming universality would IMO
be a bit of a stretch.