-
-
Notifications
You must be signed in to change notification settings - Fork 299
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
"may be considered" #131
Comments
@joe-chung Are you writing an implementation, or a schema? "may be considered" here is non-normatively describing which values have the same behavior as a missing keyword. We should probably choose a better way to express this, but it's pretty much just included as an example for implementors to verify they understand the behavior correctly. Another way to say this, is that all the following schemas should exhibit the same behavior: {}
{minLength: 0}
{minItems: 0}
{uniqueItems: false}
{minProperties: 0}
{items: []}
{properties: {}}
{additionalProperties: {}}
{additionalItems: {}} etc. These all will always validate successfully, for any instance. I guess you can think about them as default values, but strictly speaking they're just different values that exhibit the same behavior (never fails to validate). The "default" keyword in the meta-schema is expressing this, it's just supplying a value that's a sensible default for an editor to initially display if you were authoring a new JSON document from scratch -- ideally, a value that has the same behavior as a missing value. For validating an instance, remember a validation only fails if one of the keywords fails. Validation will never fail if there's no keywords. Along this line, if you're producing a schema, I wouldn't include any keywords that would never fail validation. So, I prefer Please let me know if this clarifies things, and if you have any suggestions to improve that language. |
Thank you for your response. The question is for an implementation which consumes schema. Your clarification was quite helpful. I was fine with the language, but I will consult with my colleague if he has any suggestions to improve the language. |
I apologize if this is the wrong place to ask this question.
A colleague of mine and I have come to a disagreement about this verbiage, "may be considered." What does the expression "may be considered" mean in these contexts in the JSON Schema Validation specification?
Given that these values are the assigned defaults for these properties in the online version of the JSON schema JSON, I took "may be considered" to mean that these values should be used if their respective properties are not present. My colleague disagrees and says that "may be considered" indicates that these are just suggested values and that other default values may be used instead.
The particular instance we disagreed about was "additionalProperties." He insists on setting the default value to false, saying that "may be considered" means that he does not have to interpret a missing "additionalProperties" to be an empty schema. I insist that the value should be set to an empty schema when the property is not present.
Were these values which may be considered just suggestions with intentional allowance for alternate default values, or are they to be considered recommended default values?
The text was updated successfully, but these errors were encountered: