Skip to content

Ignore unknown keywords or treat as annotations #1269

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

Merged
merged 2 commits into from
Sep 5, 2022

Conversation

handrews
Copy link
Contributor

This is just a bug fix for an accidental oversight. I'm hoping it's non-controversial as I don't think any of us meant to allow arbitrary behaviors for unrecognized keywords.

When we added the "SHOULD collect as annotations" behavior for
unknown keywords, we forgot to retain the MUST directive to ignore
them if the SHOULD is not followed. Which also ensures that
no other behavior than collecting as a annotations is performed.

This also consolidates the behavioral specification in one place
as it appeared in two places before.

When we added the "SHOULD collect as annotations" behavior for
unknown keywords, we forgot to retain the MUST directive to ignore
them if the SHOULD is not followed.  Which also ensures that
no other behavior than collecting as a annotations is performed.

This also consolidates the behavioral specification in one place
as it appeared in two places before.
@handrews handrews added Type: Bug core clarification Items that need to be clarified in the specification labels Aug 10, 2022
A JSON Schema MAY contain properties which are not schema keywords.
Unknown keywords SHOULD be treated as annotations, where the value
of the keyword is the value of the annotation.
A JSON Schema MAY contain properties which are not schema keywords or are not recognized as schema keywords.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it'd suffice to say "A JSON Schema MAY contain properties which are not recognized as schema keywords."

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh, I see this was the subject of the resolved review. no need to relitigate that if it's been sufficiently addressed, disregard if so.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@notEthan I preserved the "not schema keywords" part from the original text because I don't remember why it was phrased that way and did not want to get into a debate about whether it is OK to remove it. If you think it should be removed, we should probably discuss that in an issue. I figured adding "or are not recognized as..." would cover the more common way this is thought about without removing anything previously allowed.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sounds good to me

@handrews handrews merged commit 2c70d2e into json-schema-org:main Sep 5, 2022
@handrews handrews deleted the unknown branch September 9, 2022 06:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clarification Items that need to be clarified in the specification core
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants