Skip to content

Support for tag 55799 self-describing CBOR #300

@philandstuff

Description

@philandstuff

CBOR defines a self-describing tag which can be added to any item in a CBOR stream. It has no semantic meaning on the content:

It does not impart any
special semantics on the data item that follows; that is, the
semantics of a data item tagged with tag 55799 is exactly identical
to the semantics of the data item itself.

I therefore want to be able to decode some CBOR, but silently strip all 55799 tags as I encounter them.

CborHandle.SetInterfaceExt() seems like the right place, except that a) I don't want to add 55799 tags when I encode, and b) I want to be able to strip a 55799 tag in any location, on any item encoding any type. But adding a handler for interface{} seems like it breaks too many assumptions.

Is it possible to a) achieve this using existing codec features? or b) allow codec to (optionally) silently strip all 55799 tags when decoding?

(For context, my use case is implementing a Dhall library; it has defined CBOR semantics here, including the possibility of tag 55799 appearing anywhere.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions