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

Validate the jsonschema against default.yaml #2769

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

afbjorklund
Copy link
Member

We don't want to use the external location of the schema*, and prefer to not use the external python tool.

* that doesn't even exist yet https://www.schemastore.org/json/

https://pypi.org/project/check-jsonschema/ check-jsonschema

So make it possible for the generator to validate that the generated schema matches the default.yaml.

Closes #2768

"github.com/invopop/jsonschema"
"github.com/lima-vm/lima/pkg/limayaml"
jsonschema2 "github.com/santhosh-tekuri/jsonschema/v6"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be possible to avoid importing two jsonschema libs

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One is for generating, one is for validating. Their naming is unfortunate.

https://json-schema.org/tools?query=&languages=Go

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Their import names could be better than "1" and "2" though.

Perhaps if it was put in two different files, as helper functions?

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.

jsonschema should have tests
2 participants