Skip to content

Limit the unknown keyword annotation test to 2020-12 and later - #1236

Merged
jdesrosiers merged 2 commits into
json-schema-org:unifyfrom
kanha2213:fix-unknown-annotation-compat
Oct 31, 2026
Merged

jdesrosiers merged 2 commits into
json-schema-org:unifyfrom
kanha2213:fix-unknown-annotation-compat

Conversation

@kanha2213

Copy link
Copy Markdown
Contributor

#1229 changed the x-unknownKeyword case in annotations/tests/unknown.json to "compatibility": "2019", on the basis that x- keywords are implicit annotation keywords in 2019-09. As far as I can tell that only holds for v1. 2019-09 doesn't mention an x- prefix, and says unknown keywords should be ignored:

  • Core 4.3.1: "Unknown keywords SHOULD be ignored."
  • Core 6.5: "Implementations SHOULD ignore keywords they do not support."
  • Core 7.7.1: "Annotations are collected by keywords that explicitly define annotation-collecting behavior."

Annotations for unknown keywords start with 2020-12 (Core 6.5: "Implementations SHOULD treat keywords they do not support as annotations"; the release notes say implementations "should now include annotations for unknown keywords"), and the v1 draft makes x- keywords implicit annotation keywords. With "2019", a 2019-09 implementation that ignores unknown keywords fails this case.

This changes the case to "compatibility": "2020", which still covers v1.

It also adds a check to validation/check_validation_suite.py that fails if an annotation case asserting an x- keyword annotation applies to a dialect before 2020-12. It fails on the current unknown.json and passes with this change. Happy to drop it if you'd rather keep annotation checks out of that script.

main has an older form of the same case (no compatibility and a 2020-12 $schema). I can send a backport if that's wanted.

ADR not required.

json-schema-org#1229 made the case apply to 2019-09, but unknown keywords only produce
annotations starting with 2020-12. In 2019-09 they SHOULD be ignored,
and the x- prefix as an implicit annotation keyword is new in v1.

Add a check that cases asserting an x- keyword annotation don't apply
to earlier dialects.
@kanha2213
kanha2213 requested a review from a team as a code owner October 20, 2026 23:32

@jdesrosiers jdesrosiers left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for catching that. Drop the check_validation_suite.py changes. That's the validation suite only.

@kanha2213

Copy link
Copy Markdown
Contributor Author

Done, dropped the check_validation_suite.py change.

@jdesrosiers
jdesrosiers merged commit 18fa546 into json-schema-org:unify Oct 31, 2026
3 checks passed
jdesrosiers pushed a commit that referenced this pull request Nov 4, 2026
* Limit the unknown keyword annotation test to 2020-12 and later

#1229 made the case apply to 2019-09, but unknown keywords only produce
annotations starting with 2020-12. In 2019-09 they SHOULD be ignored,
and the x- prefix as an implicit annotation keyword is new in v1.

Add a check that cases asserting an x- keyword annotation don't apply
to earlier dialects.

* Drop the annotation check from the validation suite checker
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

Successfully merging this pull request may close these issues.

2 participants