Repository navigation
test(schemas): check schemas against Draft-07 - #406
Open
LKSNDRTMLKV wants to merge 1 commit into
Open
LKSNDRTMLKV wants to merge 1 commit into
LKSNDRTMLKV wants to merge 1 commit into
Conversation
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.
Closes #379.
Every product group schema declares Draft-07, but
schema_conformity.rsonly showed that each one compiles in the library that enforces it. That is circular: a schema the library tolerates and Draft-07 forbids would have passed. This adds the two independent checks the issue asked for, and makes the register's first conformance claim under the rule from #378.What runs
crates/dpp-tests/tests/json_schema_draft07.rs, injust check:every_shipped_schema_declares_draft07_and_is_compiled_as_draft07validator_forresolves each to Draft-07every_shipped_schema_is_valid_against_the_draft07_metaschemathe_metaschema_check_rejects_what_it_is_fortype,required,minimum,minLength,enum,patternandadditionalProperties, at any depththe_metaschema_ignores_a_misspelt_keywordevery_keyword_and_format_a_schema_uses_has_its_suite_file_vendoredevery_vendored_suite_case_passesjsonschemacrate. All pass and none is excludedthe_suite_harness_reports_what_it_is_forevery_ref_in_a_shipped_schema_is_localjsonschemawithout remote retrieval, so no schema may leave its documentthe_vendored_files_are_the_bytes_recorded_hereNOTICE.md, and an unrecorded file failsEverything passed on the first run, so no schema changed. I also broke it on purpose and reverted: a flipped suite verdict, a removed suite file, and a misspelt keyword plus an invalid
typeplanted in a shipped schema were each caught, with a message naming the problem.Vendored files
crates/dpp-tests/fixtures/json-schema/holds:json-schema-org/JSON-Schema-Test-Suite(MIT) at commit5b0ee1613e45fcc2bddac00e07c19cd49b00d8a8for the keywords and formats the schemas use, with its LICENSE.That is 164 KB in all. Source, retrieval date, size and SHA-256 of each file are in
NOTICE.md, and.gitattributespins them-text, as it does for the vendored AAS schemas. Only the files in use are vendored. When a schema needs another, the census above fails and names the file to take.crates/dpp-testsis not published.The register
The JSON Schema row of
docs/architecture/STANDARDS.mdnow readsYes, with its class, scope and known deviations, and the statement that it is self-declared. It is the first claim in the register. Not run: the keywords no schema uses (patternProperties,if/then/elseand others), and remote$refretrieval.Two edits outside the new test
standard_citations.rsskips the vendored suite directory. The suite's own text mentions RFC 8141 in its URN cases, which the tripwire counted as this repository citing it, and a register row would claim the code implements URN syntax. The files' bytes are held by their hashes instead. The skip and its reason are in the module docs.sha2andhex, both already in the workspace, are added as dev-dependencies ofdpp-testsfor the hash check.just checkis green: 1716 tests, plus the plugin suites.