norwoodj/helm-docs

Value Schema Generation

Closed this issue ยท 5 comments

It would be great if helm-docs can also generate the values.schema.json. While one could argue helm-docs should only generate the Markdown I feel it's perfectly equipped to generate JSON schema especially with the description field.

I'm using https://github.com/karuppiah7890/helm-schema-gen atm but looking at the code it basically doesn't do anything really (see here).

@estahn until today, I had never heard of this functionality for helm. It's cool!

My feeling here is that this doesn't belong in helm-docs. This tool is designed to generate markdown documentation for helm charts, full stop. Adding this in feels like bolting on a mostly orthogonal use case just to reuse the parsing logic included herein.

I really appreciate the interest in the tool, but I am trying to the extent possible to keep to the unix philosophy of every tool does one thing. That being said, I think the functionality you describe should be implemented in a separate tool, not here.

I do agree that the purpose of this tool is to generate the README, but it might be interesting to consider information in a values.schema.json (since JSON Schema has descriptions, required fields, defaults) and use it to generate the README.

  • One could use helm-schema-gen to generate a pretty basic values.schema.json.
  • This values.schema.json could then be enriched manually with meaningful data (pretty much the comments in the values.yaml but in a verifiable way - there is lots of tooling arount JSON Schema).
  • This values.schema.json will be used by Helm to validate the input, but would also be a nice source of information for the generation of a human-readable markdown documentation by helm-docs.
salzig commented

Ha, and I did came here to search/ask for the other way around. I already maintain a Schema.json and would love helm-docs to respect it for docs generation.

estahn commented

@salzig I think that would be quite valuable too.

Yes, what @alexrashed described seems like a reasonable feature request. I have no time, but I'd be happy to consider a PR for functionality like what he and @salzig are describing.