-
-
Notifications
You must be signed in to change notification settings - Fork 17
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
Idea/Feature Request: JSON schema generation from CRDs #115
Comments
Hello! Thanks for the writeup. :) I'm not opposed to it. CRD's OpenAPIV3Schema is already very close to a JSON Schema. I'm not a 100% sure it's a 1:1 convert... But let's see what we can do there. :) |
OpenApi v3.1 is 100% compatible with json-schema |
For sure, but some fields have to be adjusted and the whole thing needs to be turned into JSON. :) |
Great! |
Would this be okay, or did you imagine something else? #119 Basically a command that will generate the JSON Schema out of the CRD into a file. Nothing fancy really. |
Just tried your code - the generated json schema worked! For me right now, sufficient :D Things I found out:
|
Thanks for the feedback! 😊 |
Yeah I didn't implement any of the other flags |
ok, v0.12.0 should contain the necessary command and flag fixes. :) Please feel free to open new issues with improvement ideas. :) Thank you for using cty! :)) |
Problem Statement
Currently, the tool is highly useful for generating example YAML files from Kubernetes Custom Resource Definitions (CRDs). However, many users also require JSON schemas for better integration with development environments. JSON schemas enable powerful features like auto-completion and validation in various IDEs through YAML plugins.
Generating these schemas manually using tools like
yq
is possible, but it can be cumbersome and non-intuitive, especially for new users. Integrating JSON schema generation directly into the tool would streamline this process and provide significant value.Proposed Solution
Enhance the current tool to include functionality that:
Benefits
Conclusion
By adding JSONSchema generation to the tool, we can greatly enhance its functionality and provide users with a more powerful and intuitive development process. This feature would bridge the gap between CRD definitions and practical IDE integration, making the tool even more valuable.
What du you think @Skarlso
The text was updated successfully, but these errors were encountered: