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

Type choice semantics for targets and controllers #2

Open
anweiss opened this issue Nov 17, 2020 · 2 comments
Open

Type choice semantics for targets and controllers #2

anweiss opened this issue Nov 17, 2020 · 2 comments

Comments

@anweiss
Copy link

anweiss commented Nov 17, 2020

For some control operators, there are implied semantics on targets and controllers. For example, with .cat, both the target and controller MUST be strings. However, in the event that the target and/or controller are parenthesized types with multiple type choices between strings or bareword identifiers that resolve to type choices between strings, it isn't clear whether a validation implementation should attempt to concatenate each of the type choices, or if type choices should be disallowed altogether when used with control operators.

So for example, should:

a = ( "foo" / "foo " ) .cat b
b = "bar" / "baz"

be valid against any of the JSON strings"foobar", "foobaz", "foo bar" and "foo baz"? Or should this use of a type choice with a control operator be disallowed altogether due to potential overcomplexity on the part of the CDDL author?

@core-bot
Copy link

core-bot commented Nov 17, 2020 via email

@anweiss
Copy link
Author

anweiss commented Nov 19, 2020

Thanks for the clarity here @cabo. This is helpful.

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

2 participants