Skip to content

Feature Request: Generate values.schema.json from values.yaml or Helm templates #203

Description

@faiteanu

The plugin description reads: "The plugin provides several actions to generate JSON schemas for values of Helm charts."

Looking at the code (e.g. generateValuesJsonSchema), the method name suggests that a schema is generated from values. However, I could not find any place in the code where values.yaml is actually read from the file system, which makes the description misleading.

Feature Request

I would like to have an option to generate a values.schema.json from either:

  • a values.yaml file, or
  • the templates in the Helm chart (e.g. by analysing .Values.* references)

Example

Given the following values.yaml:

postgresDb:
  enabled: true
  instances:
    - name: mydb
      dbName: sampledatabase

and a template like this in templates/_postgresdb.yaml:

{{- if .Values.postgresDb.enabled }}
{{- range $_, $db := .Values.postgresDb.instances }}

Both representations allow deducing that postgresDb is an object with an enabled property and an instances array, which could be translated into a JSON schema automatically.
It would also be useful to support comments in values.yaml or the template that get rendered as description fields in the resulting schema.

Question

Is there a public sample repository showing the intended use of this plugin?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions