add default using comments
gioppoluca opened this issue · 3 comments
It could be also nice to have to be able to add a default annotation in the schema coming from the comment
@gioppoluca what would be the use case for this request? If you can provide an example that would be greatly appreciated.
The use case is the same for all the issues I opened.
My aim is to use the json schema to generate forms with react schema form and allow users to fill values using an easier approach.
Default is needed to set a default value in the form; the readOnly is useful to have the form display the value, but not allowing to change it since the developer could have set a proper default for it.
All these represent standard schema options as far as I know so there is no "polluting" the schema.
Developing an Internal developer portal and building custom charts is useful to have a tool like this plugin to generate the schema for an umbrella chart (for us is a product entity) that is dynamically composed of different charts.
Since we have the resultant value.yaml file of the main chart we need to generate the schema so that we'll be able to use it in a web application that digest the schema using react (https://github.com/rjsf-team/react-jsonschema-form) and display to the dev team something easier to fill up than a yaml. The result will be the final values.yaml that will be persisted in the git and digested by argocd.
Seems a bit complicated but is easier done than said.
Enrighing the plugin could greatly improve the usability of the final schema in this context.
Very interesting use case. Haven't thought about using the plugin that way. I'd be happy to add support for title, readOnly and default.