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

minExclusive and maxExclusive #119

Open
codalogic opened this issue Mar 20, 2018 · 2 comments
Open

minExclusive and maxExclusive #119

codalogic opened this issue Mar 20, 2018 · 2 comments

Comments

@codalogic
Copy link
Contributor

(Low priority)

Looking at JSON Schema, one thing I noticed JCR doesn't support is exclusive ranges. E.g.:

    "price": {
        "type": "number",
        "exclusiveMinimum": 0
    },

While a low priority feature I think we should support it.

CDDL takes the Ruby route for this of using .. for inclusive range and ... for exclusive range. I think this is confusing, especially for something that is unlikely to be used that often.

The easiest thing would be to define some suitable annotations. For example:

"range" : @{exclude-min} @{exclude-max} 0.0..100.0

(I've tried to come up with some short, meaningful names, even though they are not 100% formal computing jargon. Other names could be used.)

Other options might be:

"range" : !0.0..!100.0

Or:

"range" : 0.0<..<100.0
@anewton1998
Copy link
Contributor

I like the annotation option as these are likely to be seldom used. This seems easy enough to do. We should include it.

@codalogic
Copy link
Contributor Author

OK. I'll see if I can add that in to the Ruby.

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