fix(api/jsonschema): use unchanging JSON Schema version #14092
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.
Motivation
The current value of
$schema
inapi/jsonschema/schema.json
refers to a schema version that changes over time, which means that there's a possibility that the keywords used in the schema might change meaning unexpectedly when a new version is released.Modifications
This PR fixes the schema version to the current latest version, avoiding this potential issue by locking in the expected JSON Schema semantics and meaning that any would-be interpreter does not have to make a network request to find out what version is intended.
Verification
I checked that the new schema validates OK in a JSON schema checker.
Aside
A passing remark with regard to this comment in
hack/api/jsonschema/main.go
:It seems relatively common to use a working URL for JSON schemas URIs so this could potentially be changed to: