Skip to content

Consider support for object / array unwrapping for extention #125

@codalogic

Description

@codalogic

One option to support object and array extension might be to adopt CDDL's Unwrapping mechanism (https://tools.ietf.org/html/draft-ietf-cbor-cddl-03#section-3.7).

Syntax can be decided on, but we could say that objects or arrays referred to with a rule name preceded by two dollar signs ($$) turns the object or array into a group (unwrapping it).

So:

$myseq = { "a" : integer, "b" : boolean }

$myextendedseq = { $$myseq, "c" : string }

Resulting in $myextendedseq being treated as:

{ ( "a" : integer, "b" : boolean ), "b" : string }

For objects, we could support auto-unwrapping (because it's not ambiguous). e.g.: just require (single $ char):

$myextendedseq = { $myseq, "c" : string }

The same can't be done for arrays.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions