encodingbinarycbor

CBOR diag. notation - express seqeunce of items


I am wondering if it's possible to express just a plain sequence of concrete CBOR items in a given order, using CBOR diagnostic notation. By plain, I mean that I want to avoid using arrays for this; what I want, is stream semantics. For example:

1, "foo", true, simple(53), { a: "bar", x: 30 }, [1, 2, 3]

not this:

[1, "foo", true, simple(53), { a: "bar", x: 30 }, [1, 2, 3]]

Moreover, is it also possible to do this with CDDL (the schema definition language for CBOR)?


Solution

  • I understand what you are asking about.

    No, it appears the diagnostic notation (as implemented at http://cbor.me) does not currently support a naked sequence of CBOR objects (not an array), but yes the CBOR specification itself does permit it.

    I guess this is a bug, but diagnostic notation isn't exactly a supported feature of CBOR. You might get some responses by posting to the CBOR mailing list, see https://datatracker.ietf.org/group/cbor/about/ for the e-mail address, how to subscribe, and a searchable archive.