-
Notifications
You must be signed in to change notification settings - Fork 247
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
Definition of componentSpec in the component JSON Schema expresses no constraints #470
Comments
In also working on this with the reporter, I suspect that the |
Thanks for reporting! My 2c is it may be way easier to generate from KubeVela's go types directly - it's where the constraints are enforced indeed. |
Are these schemas even being used directly anymore then if they're being re-implemented within kubevela? |
Great. If you can generate them from a source of truth, that's always preferable. It's usually really hard to do that though, and tooling isn't there. You'd have to build your own solution. Yack shaving for sure. |
@Relequestual Yeah, we already explored it a bit actually. For example, vela now auto-generating json schema for the @z0r0 KubeVela is actually the source-of-truth for the whole thing, a possible action is we could officially export the schemas from vela api to the spec repo in next release. |
The first definition defined in the component schema looks to be incorrect.
Currently, the
componentSpec
defines no JSON Schema keywords, and so emposes no constrains as to what it should contain.I suspect this is an oversight, and you just need to nest the current object inside
properties
.This does suggest that you might not be testing your schemas to make sure they do what you want. It might be beneficial to do this to avoid this issue in the future.
You can use the same approach as per the official JSON Schema test suite, and probably borrow existing testing code in your language of choice as a result.
spec/schema/component.schema.json
Lines 45 to 87 in 21d4609
The text was updated successfully, but these errors were encountered: