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

Extract schema from document and improve validate script #2

Draft
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

cocor-au-lait
Copy link

@cocor-au-lait cocor-au-lait commented Oct 8, 2020

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 missing properties key, so I've fixed it correctly. (I thought it probably got properties key and definitions 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.

@cocor-au-lait cocor-au-lait changed the title Extracte schema from document and improve validate script Extract schema from document and improve validate script Oct 9, 2020
@cocor-au-lait
Copy link
Author

I refine to use Asciidoctor for document format. This allows to embed source code in docs, but unfortunately GitHub doesn't seem to support this feature yet ...
github/markup#1095

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

Successfully merging this pull request may close these issues.

1 participant