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

Anders Rundgren <anders.rundgren.net@gmail.com> Thu, 04 February 2016 15:52 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 D9FDD1B31E6 for <json@ietfa.amsl.com>; Thu, 4 Feb 2016 07:52:47 -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 rxoXRn_YB2iu for <json@ietfa.amsl.com>; Thu, 4 Feb 2016 07:52:46 -0800 (PST)
Received: from mail-wm0-x22c.google.com (mail-wm0-x22c.google.com [IPv6:2a00:1450:400c:c09::22c]) (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 317691B31E5 for <json@ietf.org>; Thu, 4 Feb 2016 07:52:46 -0800 (PST)
Received: by mail-wm0-x22c.google.com with SMTP id r129so218299762wmr.0 for <json@ietf.org>; Thu, 04 Feb 2016 07:52:46 -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=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; 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=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 10.28.72.197 with SMTP id v188mr26601377wma.34.1454601164759; Thu, 04 Feb 2016 07:52:44 -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 z65sm3038622wmg.1.2016.02.04.07.52.43 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 04 Feb 2016 07:52:44 -0800 (PST)
To: Carsten Bormann <cabo@tzi.org>
References: <CAMm+LwirhVcmUkdfyA3WKe_W747JTWNF1Ht2Nr8NJdDxOFCJOw@mail.gmail.com> <56B36D15.1030306@gmail.com> <56B370A1.1050508@tzi.org>
From: Anders Rundgren <anders.rundgren.net@gmail.com>
Message-ID: <56B373B8.7040305@gmail.com>
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: <56B370A1.1050508@tzi.org>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
Archived-At: <http://mailarchive.ietf.org/arch/msg/json/bfXCz4MkSQGSpHL_eqTLYKwCKjc>
Cc: Phillip Hallam-Baker <phill@hallambaker.com>, 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: 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.

Anders