Restructures the examples directory structure to enable easy testing without duplication of test data. This includes examples of invalid JSON documents that do not meet the schema.
Any partial example (e.g. location, affiliation, organization) has been moved into the partials subdirectory for clarity that it is not a working full example, but a partial one.
Full examples have been moved to a new full subdirectory with valid and invalid subdirectories underneath.
Adjusts the upstream JSON schema metaschema to use Draft7 for better integration support, as we are not using any advanced JSON schema features that necessitate a different metaschema version than one that is standard.
Adds the tests directory with a Python-based test suite that...
Checks if the schema itself is valid against the Draft07 validator from the jsonschema package.
Checks that all examples under examples/full/valid are valid against the schema.
Checks that all examples under examples/full/invalid throw ValidationError's against the schema.
Adds a GitHub Actions workflow that will run the test suite on any branch push or pull request opening
Attaches test results to the PR and Workflow summary.
Creates a central location-identifier definition, references that definition at the field level to deduplicate field definitions.
Awesome addition of test mechanisms and the partials folder -- will direct people to look at this folder either to complete extensions or try out new ones. Thanks so much @scrthq!
This PR includes the following proposed changes:
examples
directory structure to enable easy testing without duplication of test data. This includes examples of invalid JSON documents that do not meet the schema.partials
subdirectory for clarity that it is not a working full example, but a partial one.full
subdirectory withvalid
andinvalid
subdirectories underneath.tests
directory with a Python-based test suite that...jsonschema
package.examples/full/valid
are valid against the schema.examples/full/invalid
throwValidationError
's against the schema.location-identifier
definition, references that definition at the field level to deduplicate field definitions.Example PR workflow run:
https://github.com/scrthq/supplychaindata.exchange/actions/runs/11644851819
Comment on PR with results: