Re: [Cbor] hildjj/cbor-map-entries: Explicit Map datatype for CBOR, in array format

worley@ariadne.com Sat, 20 February 2021 03:54 UTC

Return-Path: <worley@alum.mit.edu>
X-Original-To: cbor@ietfa.amsl.com
Delivered-To: cbor@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 078693A109D for <cbor@ietfa.amsl.com>; Fri, 19 Feb 2021 19:54:19 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -0.983
X-Spam-Level:
X-Spam-Status: No, score=-0.983 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.25, SPF_HELO_NONE=0.001, SPF_SOFTFAIL=0.665, URIBL_BLOCKED=0.001] autolearn=no autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=comcastmailservice.net
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 4xp1DmaXJgrz for <cbor@ietfa.amsl.com>; Fri, 19 Feb 2021 19:54:16 -0800 (PST)
Received: from resqmta-ch2-12v.sys.comcast.net (resqmta-ch2-12v.sys.comcast.net [IPv6:2001:558:fe21:29:69:252:207:44]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 8B1663A109A for <cbor@ietf.org>; Fri, 19 Feb 2021 19:54:16 -0800 (PST)
Received: from resomta-ch2-10v.sys.comcast.net ([69.252.207.106]) by resqmta-ch2-12v.sys.comcast.net with ESMTP id DJGXlH2uhp8dBDJLTlnrHB; Sat, 20 Feb 2021 03:54:15 +0000
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=comcastmailservice.net; s=20180828_2048; t=1613793255; bh=0M2gvnPTho6fkOMW3/OYShAxwH0yfV8bq4QqV+ny4N0=; h=Received:Received:Received:Received:From:To:Subject:Date: Message-ID; b=S/GfF7gSXmWLVcFdkEiIe5lqO06bBBgEcq20utVj8ktffqSXxk9/XFRulqA9aexcz nvv0zyyKaZwTThzREVAE4+b6wZjfArMotMbsdJlV2o0TkzSmfantFydnOjalb7w8Fi 9BDX2IY4c1rEMUp2NkVVcLQIgNC3hfgn5vqzrOSC8BbI08vXf4d2IGajy/u+Fm6aYP 4QudD1YUlDtkFahSLx5WuVgIeN3gptgnW+9Icaug+pLFcgqcTsbAl6MifAY7iAq4c2 ozhM835BJgpgZeIcLe1UGf38xhyiJ96/g2DULFlOYncVEWl8Gow+6jnlFssutRU1iP rEVn3siPSTWrg==
Received: from hobgoblin.ariadne.com ([IPv6:2601:192:4a00:430:222:fbff:fe91:d396]) by resomta-ch2-10v.sys.comcast.net with ESMTPA id DJLPlEvLTUuBxDJLQlCiDS; Sat, 20 Feb 2021 03:54:13 +0000
X-Xfinity-VMeta: sc=0.00;st=legit
Received: from hobgoblin.ariadne.com (hobgoblin.ariadne.com [127.0.0.1]) by hobgoblin.ariadne.com (8.14.7/8.14.7) with ESMTP id 11K3sAYu002499; Fri, 19 Feb 2021 22:54:10 -0500
Received: (from worley@localhost) by hobgoblin.ariadne.com (8.14.7/8.14.7/Submit) id 11K3s8HH002479; Fri, 19 Feb 2021 22:54:08 -0500
X-Authentication-Warning: hobgoblin.ariadne.com: worley set sender to worley@alum.mit.edu using -f
From: worley@ariadne.com (Dale R. Worley)
To: Laurence Lundblade <lgl@island-resort.com>
Cc: kio@mothers-arms.co.uk, hildjj@cursive.net, cbor@ietf.org, cabo@tzi.org
In-Reply-To: <72053102-1BA1-4281-9F17-CF7A65EEA907@island-resort.com> (lgl@island-resort.com)
Sender: worley@ariadne.com (Dale R. Worley)
Date: Fri, 19 Feb 2021 22:54:08 -0500
Message-ID: <875z2no0m7.fsf@hobgoblin.ariadne.com>
Archived-At: <https://mailarchive.ietf.org/arch/msg/cbor/Jqrx6VE-OHwXg4uXvDXmebSOfoU>
Subject: Re: [Cbor] hildjj/cbor-map-entries: Explicit Map datatype for CBOR, in array format
X-BeenThere: cbor@ietf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: "Concise Binary Object Representation \(CBOR\)" <cbor.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/cbor>, <mailto:cbor-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/cbor/>
List-Post: <mailto:cbor@ietf.org>
List-Help: <mailto:cbor-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/cbor>, <mailto:cbor-request@ietf.org?subject=subscribe>
X-List-Received-Date: Sat, 20 Feb 2021 03:54:19 -0000

My previous message on this was sent at the end of a long day, and I
didn't make my point clearly.

The key idea of the proposed tag is given in the former contents of the
README.md that was referenced:

    Although CBOR has support for generic Maps (Major Type 5), some
    implementation languages (such as ECMAScript) have two different
    types they might use to hold the information, depending on whether
    all of the keys are strings or not.  This makes round-tripping
    between CBOR and native representations more difficult, and adds
    complexity in a generic decoder.

This proposal says that there will be two ways of representing maps,
major type 5, and tag 279 plus major type 4.  However, if you read the
README.md carefully, it does not assert any difference between what is
allowed to be encoded with them.  That is, it does not state which, if
either, of these representations constrains the key values to be string.
That is, it describes a need but does not provide a solution.

Now I'm pretty sure that what is *intended* is that maps encoded as tag
279 plus major type 4 require the keys to be strings.  Though it's
conceivable that it intends that keys in major type 5 be strings; that
would fix the described problem as well.

Dale