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

annotations constraint behavior is surprising #150

Closed
pbcornell opened this issue Jul 22, 2020 · 1 comment
Closed

annotations constraint behavior is surprising #150

pbcornell opened this issue Jul 22, 2020 · 1 comment

Comments

@pbcornell
Copy link

The following examples illustrate annotations constraint behavior I find surprising (or not useful), and suggests a need to revisit the specification on this topic (e.g., what's the value of defining an optional annotation? how should an "open content" annotation be handled? etc.)

Defining optional annotations doesn't appear to add any value:

type::{name:pbc,type:symbol,annotations:[a,b,c]}
-------------------------------------------------------------------
            hello: true
      a::b::hello: true
   a::b::c::hello: true
a::b::c::b::hello: true
a::b::c::d::hello: true
   c::b::a::hello: true

Defining ordered, optional annotations doesn't appear to add any value (I think the impl is treating annotations that are out-of-order as open-content):

type::{name:pbc,type:symbol,annotations:ordered::[a,b,c]}
-------------------------------------------------------------------
            hello: true
      a::b::hello: true
   a::b::c::hello: true
a::b::c::b::hello: true
a::b::c::d::hello: true
   c::b::a::hello: true

The following examples illustrate different behavior when an annotation is repeated, or is open-content:

type::{name:pbc,type:symbol,annotations:required::[a,b,c]}
-------------------------------------------------------------------
            hello: false
      a::b::hello: false
   a::b::c::hello: true
a::b::c::b::hello: true   // repetition is allowed
a::b::c::c::hello: true   // repetition is allowed?
a::b::c::d::hello: true   // open content is allowed?
   c::b::a::hello: true
type::{name:pbc,type:symbol,annotations:required::ordered::[a,b,c]}
-------------------------------------------------------------------
            hello: false
      a::b::hello: false
   a::b::c::hello: true
a::b::c::b::hello: true   // repetition is allowed
a::b::c::c::hello: false  // repetition is denied?
a::b::c::d::hello: true   // open content is denied?
   c::b::a::hello: false
@popematt
Copy link
Contributor

This surprising behavior will be left as-is in Ion Schema 1.0 (and so the implementation will not be "fixed"). The potential for this surprising behavior is eliminated in Ion Schema 2.0.

@popematt popematt closed this as not planned Won't fix, can't repro, duplicate, stale Sep 21, 2022
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