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

Add JSON schema validation functionality #160

Open
thrix opened this issue May 17, 2022 · 2 comments
Open

Add JSON schema validation functionality #160

thrix opened this issue May 17, 2022 · 2 comments

Comments

@thrix
Copy link
Collaborator

thrix commented May 17, 2022

FMF should be able to consume a validation scheme to validate the metadata against.

@LecrisUT
Copy link
Contributor

LecrisUT commented Aug 8, 2023

Although #161 is meged I think this can be improved

  • define the local/remote path to the schema in .fmf/version, other metadata file or in a default file schema.json
  • add the validation to the __init__ or add some helper classes/constructors like TreeValidated that automatically runs the validation if schema is found
  • add a cli to detect/download all the json schema used for the current fmf tree

@LecrisUT
Copy link
Contributor

LecrisUT commented Dec 5, 2023

I have been playing around implementing my own schema and considering the schemas in tmt:

  • The schema validation should be done on the generated fmf tree, instead on the yaml file itself. The reason is that the +/- operators can easily break the validation. Validating against adjust would be tricky though
  • The $ref is a bit ambiguous. I managed to get it to work if I specify the sub_schema.yaml instead of the $id, when working with pycharm. Maybe things will work better within the python code if we define appropriate schema stores

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

No branches or pull requests

2 participants