Repository navigation
docs(schema): record schema version 1.1.0 via $comment - #31
Merged
Merged
Conversation
Make the schema artifact self-describing about its version. JSON Schema has no standard 'version' keyword in any draft (07/2019-09/2020-12), and a custom top-level 'version' breaks AJV strict mode (used by the validate script and by downstream AJV consumers). $comment is the official draft-07 annotation keyword for non-validating notes, so it carries the version + the v1-$id/versioned-URL convention without any tooling change. Full suite stays green. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Makes
schema/v1.jsonself-describing about its version — you asked whether the schema shouldn't carry its version. It should, and now does, via$comment.Why not a
versionfield?versionis not a standard keyword in any JSON Schema draft (07, 2019-09, or 2020-12 — verified against the spec's annotation-keyword list). A custom top-levelversionbreaks AJV strict mode, which both this repo'svalidatescript and downstream AJV consumers (renderer, validator) use — it errors withstrict mode: unknown keyword: "version"and fails the suite. Upgrading the JSON Schema draft would not help, since no draft adds aversionkeyword.Why not the filename?
The
$id/filename staysv1.jsondeliberately: it's the schema's canonical identity and the major compatibility line. 1.1.0 is a backwards-compatible (additive) change, so every document's existing"$schema": ".../schema/v1.json"stays valid. Renaming tov1.1.jsonwould 404 all 44 existing documents and force every future doc to know the exact minor. Version-pinned copies already live at/<version>/ocf-action-v1.json.The fix
$commentis the official draft-07 annotation keyword for non-validating notes. It records the version (1.1.0) and the$id-stays-v1 / versioned-URL convention, with zero tooling changes.Test Plan
npx ajv compile --strictpasses (schema valid)🤖 Generated with Claude Code