Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test_json.py: Validate JSON files against JSON Schema #7

Open
jpmckinney opened this issue Aug 16, 2017 · 3 comments
Open

test_json.py: Validate JSON files against JSON Schema #7

jpmckinney opened this issue Aug 16, 2017 · 3 comments
Labels

Comments

@jpmckinney
Copy link
Member

jpmckinney commented Aug 16, 2017

2019 update: Running the following on each of the standard, profile, extension repos:

find . -name '*.json' -not -name 'extension.json' -not -name '*-schema.json' -not -path '*metaschema*' -not -path '*/_static/docson/*'

Only these have OCDS JSON files:

  • standard/docs/en/examples
  • standard/docs/en/examples/merging
  • infrastructure/docs/examples
  • public-private-partnerships/docs/examples (from OCDS Show)
  • ocds_budget_and_spend_extension/examples
  • ocds_contract_completion_extension/examples

Off the top of my head, we'd need to:

  • Determine whether this JSON file has an appropriate JSON Schema to validate against
  • Determine which JSON Schema to use (based on the presence of keys and the version)
  • Support extensions and automatically extend the JSON Schema
@jpmckinney jpmckinney changed the title script.sh: Validation of JSON files against JSON Schema script.sh: Validate JSON files against JSON Schema Aug 16, 2017
@jpmckinney jpmckinney changed the title script.sh: Validate JSON files against JSON Schema test_json.py: Validate JSON files against JSON Schema Sep 27, 2017
@jpmckinney jpmckinney self-assigned this Sep 29, 2017
@Bjwebb
Copy link
Contributor

Bjwebb commented Sep 29, 2017

Note that the python jsonschema library doesn't check formats by default, you need to set it up explicitly https://python-jsonschema.readthedocs.io/en/latest/validate/#validating-formats

@jpmckinney
Copy link
Member Author

jpmckinney commented Nov 26, 2018

@jpmckinney jpmckinney self-assigned this Sep 28, 2019
@jpmckinney jpmckinney removed their assignment Dec 1, 2019
@jpmckinney
Copy link
Member Author

The standard repo now has a lot of JSON files for worked examples, so this is no longer low priority.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants