Extract schema from document and improve validate script #2
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.
Overview
Thanks to the development team.
For more general purpose, I've changed some project structure and Python script.
In additional, I've fixed some typo and schema definition errors.
Extract json from document
I've extract schema json and example json from each document.
Schema json files are located in
/Schemas
directory.By making it standalone json file, Developers can fetch the latest json schema from the master branch URL.
Example json files are located in
/Examples
directory.By using Python validation script, it can check that the json example is implemented correctly.
Each document files includes links to each json files, but I'm sorry anyone who get frustrated by the amount of moving pages.
Improvements to Python validate script
Since Python 2.x is EOL, I've implemented simply by using Python 3.x powerful features.
It can specify target path from the argument and automatically detect requiered extensions from files in
/Schemas
.I hope this will save you a lot of maintenance 😃
In additional that, I imitated a colorful test log I've seen somewhere.
Fixing schema definition errors
cdi3.schema.json
was broken because of missingproperties
key, so I've fixed it correctly. (I thought it probably gotproperties
key anddefinitions
key wrong.)By the way, it's hard to write the json schema by hand typing 😞 Is there a good tool for more useful.
Testing
I've checked the varidation script and example json files was implemented correctly.
If the json implementation is not correct, script returns an error with messages like following.
Others
In this repository, there is no license statements about license, and no copyright comment in
checkscript.py
.Other repository has it, so I think it was better to describe.
Best regards.