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

From: Christophe Lohr <[email-masked]>
Date: Wed, 11 Sep 2019 08:39:32 +0200

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

---

From: Carsten Bormann <[email-masked]>
Date: Wed, 11 Sep 2019 09:51:07 +0300

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 <[email-masked]> wrote:
> 
> Hi,
> 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
> [email-masked]
> https://www.ietf.org/mailman/listinfo/cbor