rhoat / helm-schema-gen

So that you don't have to write values.schema.json by hand from scratch for your Helm 3 charts.
MIT License
0 stars 0 forks source link

add rendering notes about schema output to comments #5

Open SQLJames opened 4 hours ago

SQLJames commented 4 hours ago

I ran into issues when running the schema gen tool on my chart mentioning the below error when trying to install my chart

Error: values don't meet the specifications of the schema(s) in the following chart(s): factorio-server-charts: - map_gen_settings.seed: Invalid type. Expected: null, given: integer - map_gen_settings.starting_area: Invalid type. Expected: integer, given: number

I would like to be able to define comments that give hints on what will be output as the type. Using a similar format as the Markers for controller-gen we can adopt a common schema for this implementation https://book.kubebuilder.io/reference/markers#markers-for-configcode-generation

map_gen_settings:
  # Width and height of map, in tiles; 0 means infinite
  width: 0
  # Width and height of map, in tiles; 0 means infinite
  height: 0
  # Multiplier for biter free zone radius
  # +schemagen:type:number
  starting_area: 1

this would output

                "starting_area": {
                    "type": "number"
                },

instead of the default

                "starting_area": {
                    "type": "integer"
                },