Re: [Cbor] What's your opinion of using CDDL to simultaneously define CBOR and JSON?

Laurence Lundblade <lgl@island-resort.com> Thu, 09 September 2021 17:21 UTC

Return-Path: <lgl@island-resort.com>
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 E3A063A0874 for <cbor@ietfa.amsl.com>; Thu, 9 Sep 2021 10:21:33 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.895
X-Spam-Level:
X-Spam-Status: No, score=-1.895 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_NONE=0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
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 iv0Xma89SQGd for <cbor@ietfa.amsl.com>; Thu, 9 Sep 2021 10:21:29 -0700 (PDT)
Received: from p3plsmtpa07-08.prod.phx3.secureserver.net (p3plsmtpa07-08.prod.phx3.secureserver.net [173.201.192.237]) (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 373EF3A086A for <cbor@ietf.org>; Thu, 9 Sep 2021 10:21:29 -0700 (PDT)
Received: from [192.168.1.3] ([75.80.148.243]) by :SMTPAUTH: with ESMTPSA id ONjsmkCqUxud2ONjsmhlhP; Thu, 09 Sep 2021 10:21:28 -0700
X-CMAE-Analysis: v=2.4 cv=Cc7NWJnl c=1 sm=1 tr=0 ts=613a4298 a=VPU1mRQhDhA4uSX60JRRww==:117 a=VPU1mRQhDhA4uSX60JRRww==:17 a=IkcTkHD0fZMA:10 a=gKmFwSsBAAAA:8 a=K6EGIJCdAAAA:8 a=_5BbaypkvQYyewsfQ_cA:9 a=QEXdDO2ut3YA:10 a=nnPW6aIcBuj1ljLj_o6Q:22 a=L6pVIi0Kn1GYQfi8-iRI:22
X-SECURESERVER-ACCT: lgl@island-resort.com
Content-Type: text/plain; charset="utf-8"
Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.1\))
From: Laurence Lundblade <lgl@island-resort.com>
In-Reply-To: <84FA287D-2FEA-442E-9102-7AE805E48A2E@tzi.org>
Date: Thu, 09 Sep 2021 10:21:28 -0700
Cc: Michael Richardson <mcr+ietf@sandelman.ca>, cbor@ietf.org
Content-Transfer-Encoding: quoted-printable
Message-Id: <97041D0B-7618-462F-8756-46B34131B218@island-resort.com>
References: <51537C68-F495-4750-9376-A637BD0E78DD@island-resort.com> <19710.1631126881@localhost> <84FA287D-2FEA-442E-9102-7AE805E48A2E@tzi.org>
To: Carsten Bormann <cabo@tzi.org>
X-Mailer: Apple Mail (2.3608.120.23.2.1)
X-CMAE-Envelope: MS4xfN0z65KqJwIy+A8b/hcWQEG+3IKB3o4x47VJdg8EtkTxCdnGJmXk11/7F+9hlPU3W7WtpzFlKaEqPYnYJ5JESK65dE1RLGVVX+hD1JP5xpA5edCJx2m8 eWRV4wZeob7jxdYQggo9d1fNeZih26VljNXUjIs+rk+GwQb00pfeyTd7adHefshQjf4I6hV15ClD9vWsqBjUDnVaogDJJ5Qkj/m/bDKYj4rI/A+aG7TGalAj
Archived-At: <https://mailarchive.ietf.org/arch/msg/cbor/5etaFNiv5yBsJXkIx9vsC3UiU3U>
Subject: Re: [Cbor] What's your opinion of using CDDL to simultaneously define CBOR and JSON?
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: Thu, 09 Sep 2021 17:21:34 -0000

> On Sep 8, 2021, at 12:14 PM, Carsten Bormann <cabo@tzi.org> wrote:
>> 
>> Laurence Lundblade <lgl@island-resort.com> wrote:
>>> Right now, the EAT draft is using CDDL to simultaneously define the EAT
>>> protocol such that it can be encoded in either CBOR or JSON. This also
>>> gives transcoding of the protocol between CBOR and JSON which is useful
>>> at the Verifier. There is also some interest in expanding to
>>> ASN.1. That seems doable. Then maybe on to YANG, but that seems harder.
> 
> Less is more.
> I don’t know why people think that having the same data in five different representations aids interoperability.

Very much agree that less is more. I think two are generally enough and sometimes necessary:

— JSON because it is ubiquitous
— CBOR because JSON is not compact

There may be some protocols where only one or the other is enough, but I think both may actually be necessary for some protocols. People thought it was necessary for CWT and JWT. I think it is necessary for EAT for example. EAT would be of far less value if it only supported one or the other.

It would be nice to have general, well-understood conventions for using CDDL to define protocols that encode in both JSON and CBOR.

We should generally resist encodings like DER and XML, but they are not out of the question for specific use cases.

LL