-
Notifications
You must be signed in to change notification settings - Fork 5
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
default annotation #120
Comments
I don't understand the use case. What does it mean? If the value is not there then assume a default value? Why would a validator care? I think for XSD and JSON Schema, the want to address instances where tool chains are generating code. Is that where we want to go? |
For the use-case... In YANG (imagine it's actually JSON!), the
If defined in JCR, the definition would be:
But the question is, what happens when
let's the spec reader and implementer readily know what the semantics are without having to scan through the text. The following might also work:
I agree that a validator wouldn't benefit from it, but I think humans might. That said, I think we can wait on this one if we think there are more important things. |
Ok. As long as we are clear that is really for humans and not validators, I'm good with it. Your annotation approach is my preference. |
(Even lower priority?)
Similar to the situation with the minExclusive and maxExclusive issue (#119), JSON Schema (+ XSD, but not in the base of Relax NG) has a
default
property.If this were thought useful for JCR, it could be another annotation. For example:
I hope limiting the feature to primitive types would be sufficient, especially as braces can't go in annotations. If object default were thought to be necessary, we could do something like:
The text was updated successfully, but these errors were encountered: