-
Notifications
You must be signed in to change notification settings - Fork 123
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
Migrate to santhosh-tekuri/jsonschema #168
Conversation
FYI @eyarz since I know you're using kubeconform quite a bit - this is swapping the kubeconform engine 🥳 tests pass fine (despite minor differences in error messages) and performance seems on par. Just a heads up if you can think of something that might break - so far it seems a perfectly good replacement. We'd be using a better maintained JSON schema validation lib, which might enable new features. |
I wonder if they have interest in adding HTTP references https://github.com/santhosh-tekuri/jsonschema/blob/56baa8bb9ba78e8da42c113f788b8b17b2565f15/loader.go#L32 |
@yannh thank you for the heads up! |
@eyarz I think this is good to merge now, passes all tests and additional tests I added. There might be slight differences in the output of errors. I won't make a new release just yet 👍 |
yes, this change will break how we parse and view kubeconform output. |
This migrates the JSON validation from https://github.com/xeipuuv/gojsonschema (unmaintained) to https://github.com/santhosh-tekuri/jsonschema . The "error messages with json-pointers to exact location" feature seems quite nice. It would be nice to also be able to solve xeipuuv/gojsonschema#322
Unit & Acceptance tests pass nicely but I've added a test for using the "non standalone" schemas (that contain HTTP references) and that currently fails. Tracking here santhosh-tekuri/jsonschema#102
While it would be a breaking change, Kubeconform uses the standalone files by default, and I am not sure if anyone uses the non-standalone schemas nor why someone would use those with Kubeconform, so I might release this as a breaking change, unless the feature gets implemented in jsonschema.