-
Notifications
You must be signed in to change notification settings - Fork 213
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
[feature] YAML Schema validation for syntax compatibility check #348
Comments
I changed the title because I believe that schema validation provides just what we need here. It allows to check your YAML even before running WireViz. Example from https://github.com/redhat-developer/yaml-language-server :
|
Found this file by @cooked as a starting point: wireviz-yaml-schema.json TODO
|
Additional to JSON Schema based validation that is widely supported, there is also 23andMe/Yamale which relies on its own schema defined in YAML itself. It can read data through either PyYAML or Ruamel, so choosing this would depend on the parser choice taken in #223. I would like to mention that checks like in 9b2b22d will not be needed if schema validation was done programmatically. Note that the validation should also take effect with the GH action Create Examples once implemented. |
With respect to the latest backwards-incompatible changes, input files may require some compatibility check. It is quite common that drawings are revised after many years.
May I suggest adding an (optional) "syntax version" tag? How else could it be assured that future versions of WireViz support the syntax of an older one?Note that following issue was raised by @nanangp for adding versioning checks on the CLI syntax as well:
nanangp/vscode-wireviz-preview#6
Going a bit further, some of the settings given as a command line argument, could also be listed in a header of the YAML file. This could either be a comment or incorporated in the WireViz syntax, like the technical drawing changes require adding some general info for the title block as well.
This suggestion might also be important for #223 YAML parser replacement.
The text was updated successfully, but these errors were encountered: