Re: [Cbor] CDDL: how to choose between json and cbor?

Carsten Bormann <cabo@tzi.org> Wed, 11 September 2019 06:51 UTC

Return-Path: <cabo@tzi.org>
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 DED9C12010C for <cbor@ietfa.amsl.com>; Tue, 10 Sep 2019 23:51:21 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -4.196
X-Spam-Level:
X-Spam-Status: No, score=-4.196 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_MED=-2.3, 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 ktDSXojleFhJ for <cbor@ietfa.amsl.com>; Tue, 10 Sep 2019 23:51:20 -0700 (PDT)
Received: from mailhost.informatik.uni-bremen.de (mailhost.informatik.uni-bremen.de [IPv6:2001:638:708:30c9::12]) (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 758981200B9 for <cbor@ietf.org>; Tue, 10 Sep 2019 23:51:19 -0700 (PDT)
X-Virus-Scanned: amavisd-new at informatik.uni-bremen.de
Received: from submithost.informatik.uni-bremen.de (submithost2.informatik.uni-bremen.de [IPv6:2001:638:708:30c8:406a:91ff:fe74:f2b7]) by mailhost.informatik.uni-bremen.de (8.14.5/8.14.5) with ESMTP id x8B6p9mM027966; Wed, 11 Sep 2019 08:51:14 +0200 (CEST)
Received: from [100.97.11.2] (ip-109-40-2-178.web.vodafone.de [109.40.2.178]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by submithost.informatik.uni-bremen.de (Postfix) with ESMTPSA id 46SsxT3c6Kz1Bp8; Wed, 11 Sep 2019 08:51:09 +0200 (CEST)
Content-Type: multipart/alternative; boundary="Apple-Mail-BAA421B3-F307-4F4C-995F-C6EC000D4B24"
Mime-Version: 1.0 (1.0)
From: Carsten Bormann <cabo@tzi.org>
X-Mailer: iPhone Mail (16G102)
In-Reply-To: <3701e2ee-8fa6-2d4d-d07c-7c172d7de1ef@imt-atlantique.fr>
Date: Wed, 11 Sep 2019 09:51:07 +0300
Cc: cbor@ietf.org
Content-Transfer-Encoding: 7bit
Message-Id: <A1005A12-2510-40F3-82D8-EB708E60F0A1@tzi.org>
References: <3701e2ee-8fa6-2d4d-d07c-7c172d7de1ef@imt-atlantique.fr>
To: Christophe Lohr <christophe.lohr@imt-atlantique.fr>
Archived-At: <https://mailarchive.ietf.org/arch/msg/cbor/dJRXsfcVfrhGXag4cB5mmgKaDgo>
Subject: Re: [Cbor] CDDL: how to choose between json and cbor?
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: Wed, 11 Sep 2019 06:51:22 -0000

Hi Christophe,

Quick answer while I am on vacation: please see rfc 8428 as an example for one way to do this. Having more control from the language about this certainly is on the plate for the next version of CDDL, but senml (8428) shows it can be done today. 

Sent from mobile, sorry for terse

> On 11. Sep 2019, at 09:39, Christophe Lohr <christophe.lohr@imt-atlantique.fr> wrote:
> 
> Hi,
> Sorry for my naive question that probably has already been discussed
> but, how to choose between json and cbor within a cddl specification?
> 
> Now, I can use cddl to specify the data model for my system.  But I also have to specify if data/messages instances are coded in json or in cbor.  
> Must I specify this in natural language in a documenation elswere (because this concern is at another level), or is there a mean within cddl to express the choice cbor vs json?
> 
> Best regards
> Christophe
> 
> _______________________________________________
> CBOR mailing list
> CBOR@ietf.org
> https://www.ietf.org/mailman/listinfo/cbor