Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider support for object / array unwrapping for extention #125

Open
codalogic opened this issue Aug 2, 2018 · 0 comments
Open

Consider support for object / array unwrapping for extention #125

codalogic opened this issue Aug 2, 2018 · 0 comments

Comments

@codalogic
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant