{"id":15102805,"url":"https://github.com/dadav/helm-schema","last_synced_at":"2026-01-16T16:20:40.620Z","repository":{"id":189220521,"uuid":"678563035","full_name":"dadav/helm-schema","owner":"dadav","description":"Generate jsonschemas from helm charts.","archived":false,"fork":false,"pushed_at":"2026-01-15T09:04:53.000Z","size":25484,"stargazers_count":228,"open_issues_count":13,"forks_count":28,"subscribers_count":2,"default_branch":"main","last_synced_at":"2026-01-15T15:25:16.661Z","etag":null,"topics":["hacktoberfest","helm","jsonschema"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dadav.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2023-08-14T21:04:22.000Z","updated_at":"2026-01-15T13:04:03.000Z","dependencies_parsed_at":"2023-11-14T16:28:46.634Z","dependency_job_id":"de3453df-603f-44f1-b471-1d3739c2b857","html_url":"https://github.com/dadav/helm-schema","commit_stats":{"total_commits":177,"total_committers":7,"mean_commits":"25.285714285714285","dds":0.1807909604519774,"last_synced_commit":"f03384716a31f97f5d2f975ddeaa1ca5042548a4"},"previous_names":["dadav/helm-schema"],"tags_count":47,"template":false,"template_full_name":null,"purl":"pkg:github/dadav/helm-schema","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dadav%2Fhelm-schema","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dadav%2Fhelm-schema/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dadav%2Fhelm-schema/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dadav%2Fhelm-schema/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dadav","download_url":"https://codeload.github.com/dadav/helm-schema/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dadav%2Fhelm-schema/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28479611,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-16T11:59:17.896Z","status":"ssl_error","status_checked_at":"2026-01-16T11:55:55.838Z","response_time":107,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["hacktoberfest","helm","jsonschema"],"created_at":"2024-09-25T19:07:04.707Z","updated_at":"2026-01-16T16:20:40.606Z","avatar_url":"https://github.com/dadav.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# helm-schema\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"images/logo.png\" width=\"400\" /\u003e\n  \u003cbr /\u003e\n  \u003ca href=\"https://github.com/dadav/helm-schema/releases\"\u003e\u003cimg src=\"https://img.shields.io/github/release/dadav/helm-schema.svg\" alt=\"Latest Release\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://pkg.go.dev/github.com/dadav/helm-schema?tab=doc\"\u003e\u003cimg src=\"https://godoc.org/github.com/golang/gddo?status.svg\" alt=\"Go Docs\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://github.com/dadav/helm-schema/actions\"\u003e\u003cimg src=\"https://img.shields.io/github/actions/workflow/status/dadav/helm-schema/build_and_test.yml\" alt=\"Build Status\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://opensource.org/licenses/MIT\"\u003e\u003cimg src=\"https://img.shields.io/badge/License-MIT-green.svg\" alt=\"MIT LICENSE\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://github.com/pre-commit/pre-commit\"\u003e\u003cimg src=\"https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit\" alt=\"pre-commit\" style=\"max-width:100%;\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://goreportcard.com/badge/github.com/dadav/helm-schema\"\u003e\u003cimg src=\"https://goreportcard.com/badge/github.com/dadav/helm-schema\" alt=\"Go Report\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003eThis tool tries to help you to easily create some nice \u003ca href=\"https://json-schema.org/\" target=\"_blank\"\u003e\u003cstrong\u003eJSON schema\u003c/strong\u003e\u003c/a\u003e for your helm chart.\u003c/p\u003e\n\nBy default it will traverse the current directory and look for `Chart.yaml` files.\nFor every file, helm-schema will try to find one of the given value filenames.\nThe first files found will be read and a jsonschema will be created.\nFor every dependency defined in the `Chart.yaml` file, a reference to the dependencies JSON schema\nwill be created.\n\n\u003e [!NOTE]\n\u003e The tool uses `jsonschema` Draft 7, because the library helm uses only supports that version.\n\n## Installation\n\nVia `go` install:\n\n```sh\ngo install github.com/dadav/helm-schema/cmd/helm-schema@latest\n```\n\nFrom `aur`:\n\n```sh\nparu -S helm-schema\n```\n\nVia `podman/docker`:\n\n```sh\npodman run --rm -v $PWD:/home/helm-schema ghcr.io/dadav/helm-schema:latest\n```\n\nAs `helm plugin`:\n\n```sh\nhelm plugin install https://github.com/dadav/helm-schema\n```\n\n### Plugin Verification (Helm v4+)\n\nHelm v4 introduced plugin verification for enhanced security. All helm-schema releases are signed with GPG and include provenance files (`.prov`) for verification.\n\n**Automatic Verification (Recommended)**\n\nHelm v4 verifies plugin signatures by default:\n\n```sh\n# Install from a specific release with automatic verification\nhelm plugin install https://github.com/dadav/helm-schema/releases/download/v0.18.1/helm-schema_0.18.1_Linux_x86_64.tar.gz\n```\n\n**Manual Verification**\n\nBefore installing, import the signing key:\n\n```sh\n# Import the public signing key\ngpg --keyserver keyserver.ubuntu.com --recv-keys [KEY_ID]\n\n# Install with explicit verification\nhelm plugin install https://github.com/dadav/helm-schema/releases/download/v0.18.1/helm-schema_0.18.1_Linux_x86_64.tar.gz --verify\n```\n\n**Verify Installed Plugin**\n\n```sh\n# Verify an already installed plugin\nhelm plugin verify schema\n```\n\n\u003e [!NOTE]\n\u003e Plugin verification requires Helm v4 or later. If using Helm v3, signatures will be ignored.\n\n## Usage\n\n### Pre-commit hook\n\nIf you want to automatically generate a new `values.schema.json` if you change the `values.yaml`\nfile, you can do the following:\n\n1. Install [`pre-commit`](https://pre-commit.com/#install)\n2. Copy the [`.pre-commit-config.yaml`](./.pre-commit-config.yaml) to your helm chart repository.\n3. Then run these commands:\n\n```sh\npre-commit install\npre-commit install-hooks\n```\n\n### Running the binary directly\n\nYou can also just run the binary yourself:\n\n```sh\nhelm-schema\n```\n\n### Options\n\nThe binary has the following options:\n\n```sh\nFlags:\n  -r, --add-schema-reference                   \"add reference to schema in values.yaml if not found\"\n  -w, --allow-circular-dependencies            \"allow circular dependencies between charts (will log a warning instead of failing)\"\n  -a, --append-newline                         \"append newline to generated jsonschema at the end of the file\"\n  -c, --chart-search-root string               \"directory to search recursively within for charts (default \".\")\"\n  -i, --dependencies-filter strings            \"only generate schema for specified dependencies (comma-separated list of dependency names)\"\n  -g, --dont-add-global                        \"dont auto add global property\"\n  -x, --dont-strip-helm-docs-prefix            \"disable the removal of the helm-docs prefix (--)\"\n  -d, --dry-run                                \"don't actually create files just print to stdout passed\"\n  -p, --helm-docs-compatibility-mode           \"parse and use helm-docs comments\"\n  -h, --help                                   \"help for helm-schema\"\n  -s, --keep-full-comment                      \"keep the whole leading comment (default: cut at empty line)\"\n  -l, --log-level string                       \"level of logs that should printed, one of (panic, fatal, error, warning, info, debug, trace) (default \"info\")\"\n  -n, --no-dependencies                        \"don't analyze dependencies\"\n  -o, --output-file string                     \"jsonschema file path relative to each chart directory to which jsonschema will be written (default 'values.schema.json')\"\n  -m, --skip-dependencies-schema-validation    \"skip schema validation for dependencies by setting additionalProperties to true and removing from required\"\n  -f, --value-files strings                    \"filenames to check for chart values (default [values.yaml])\"\n  -k, --skip-auto-generation strings           \"skip the auto generation for these fields (default [])\"\n  -u, --uncomment                              \"consider yaml which is commented out\"\n  -v, --version                                \"version for helm-schema\"\n```\n\n## Annotations\n\nThe `jsonschema` must be between two entries of `# @schema` :\n\n```yaml\n# @schema\n# my: annotation\n# @schema\n# you can add comment here as well\nfoo: bar\n```\n\n\u003e [!WARNING]\n\u003e It must be written just above the key you want to annotate.\n\n\u003e [!NOTE]\n\u003e If you don't use the `properties` option on hashes/objects or don't use `items` on arrays, it will be parsed from the values and their annotations instead.\n\n### Root-level annotations\n\nYou can apply schema annotations to the root schema object itself using `# @schema.root`:\n\n```yaml\n# @schema.root\n# title: My Chart Values\n# description: Configuration values for my Helm chart\n# x-custom-field: custom-value\n# @schema.root\n# @schema\n# enum: [dev, staging, prod]\n# @schema\n# Example description foo baz\nstage: dev\n```\n\n\u003e [!NOTE]\n\u003e The `@schema.root` block must be placed before the first key in your `values.yaml` file, without blank lines after it (unless you use the `-s` flag to keep full comments).\n\n### Available annotations\n\n\u003c!-- prettier-ignore --\u003e\n| Key| Description | Values |\n|-|-|-|\n| [`type`](#type) | Defines the [jsonschema-type](https://json-schema.org/understanding-json-schema/reference/type.html) of the object. Multiple values are supported (e.g. `[string, integer]`) as a shortcut to `anyOf` | `object`, `array`, `string`, `number`, `integer`, `boolean` or `null` |\n| [`title`](#title) | Defines the [title field](https://json-schema.org/understanding-json-schema/reference/generic.html?highlight=title) of the object | Defaults to the key itself |\n| [`description`](#description) | Defines the [description field](https://json-schema.org/understanding-json-schema/reference/generic.html?highlight=description) of the object. | Defaults to the comments just above or below the `@schema` annotations block |\n| [`default`](#default) | Sets the default value and will be displayed first on the users IDE| Takes a `string` |\n| [`properties`](#properties) | Contains a map with keys as property names and values as schema | Takes an `object` |\n| [`pattern`](#pattern) | Regex pattern to test the value | Takes an `string` |\n| [`format`](#format) | The [format keyword](https://json-schema.org/understanding-json-schema/reference/string.html#format) allows for basic semantic identification of certain kinds of string values | Takes a [keyword](https://json-schema.org/understanding-json-schema/reference/string.html#format) |\n| [`required`](#required) | Adds the key to the required items | `true` or `false` or `array` |\n| [`deprecated`](#deprecated) | Marks the option as deprecated | `true` or `false` |\n| [`items`](#items) | Contains the schema that describes the possible array items | Takes an `object` |\n| [`enum`](#enum) | Multiple allowed values. Accepts an array of `string` | Takes an `array` |\n| [`const`](#const) | Single allowed value | Takes a `string`|\n| [`examples`](#examples) | Some examples you can provide for the end user | Takes an `array` |\n| [`minimum`](#minimum) | Minimum value. Can't be used with `exclusiveMinimum` | Takes a `number` (integer or float). Must be smaller than `maximum` or `exclusiveMaximum` (if used) |\n| [`exclusiveMinimum`](#exclusiveminimum) | Exclusive minimum. Can't be used with `minimum` | Takes a `number` (integer or float). Must be smaller than `maximum` or `exclusiveMaximum` (if used) |\n| [`maximum`](#maximum) | Maximum value. Can't be used with `exclusiveMaximum` | Takes a `number` (integer or float). Must be bigger than `minimum` or `exclusiveMinimum` (if used) |\n| [`exclusiveMaximum`](#exclusivemaximum) | Exclusive maximum value. Can't be used with `maximum` | Takes a `number` (integer or float). Must be bigger than `minimum` or `exclusiveMinimum` (if used) |\n| [`multipleOf`](#multipleof) | The yaml-value must be a multiple of. For example: If you set this to 0.1, allowed values would be 0, 0.1, 0.2... | Takes a `number` (integer or float, must be \u003e 0) |\n| [`additionalProperties`](#additionalproperties) | Allow additional keys in maps. Useful if you want to use for example `additionalAnnotations`, which will be filled with keys that the `jsonschema` can't know| Defaults to `false` if the map is not an empty map. Takes a schema or boolean value |\n| [`patternProperties`](#patternproperties) | Contains a map which maps schemas to pattern. If properties match the patterns, the given schema is applied| Takes an `object` |\n| [`anyOf`](#anyof) | Accepts an array of schemas. None or one must apply | Takes an `array` |\n| [`oneOf`](#oneof) | Accepts an array of schemas. One or more must apply | Takes an `array` |\n| [`allOf`](#allof) | Accepts an array of schemas. All must apply| Takes an `array` |\n| [`not`](#not) | A schema that must not be matched. | Takes an `object` |\n| [`if/then/else`](#ifthenelse) | `if` the given schema applies, `then` also apply the given schema or `else` the other schema| Takes an `object` |\n| [`$ref`](#ref) | Accepts an URI to a valid `jsonschema`. Extend the schema for the current key | Takes an URI (or relative file) |\n| [`minLength`](#minlength) | Minimum string length. | Takes an `integer`. Must be smaller or equal than `maxLength` (if used) |\n| [`maxLength`](#maxlength) | Maximum string length. | Takes an `integer`. Must be greater or equal than `minLength` (if used) |\n| [`minItems`](#minItems) | Minimum length of an array. | Takes an `integer`. Must be smaller or equal than `maxItems` (if used) |\n| [`maxItems`](#maxItems) | Maximum length of an array. | Takes an `integer`. Must be greater or equal than `minItems` (if used) |\n| [`contains`](#contains) | Array must contain at least one item matching this schema | Takes a schema `object` |\n| [`additionalItems`](#additionalItems) | Schema for array items beyond those defined in `items` tuple | Takes a `boolean` or schema `object` |\n| [`minProperties`](#minProperties) | Minimum number of properties in an object | Takes an `integer` \u003e= 0 |\n| [`maxProperties`](#maxProperties) | Maximum number of properties in an object | Takes an `integer` \u003e= 0 |\n| [`propertyNames`](#propertyNames) | Schema that all property names must match | Takes a schema `object` |\n| [`dependencies`](#dependencies) | Property dependencies (presence of one property requires others) | Takes an `object` mapping property names to arrays or schemas |\n| [`definitions`](#definitions) | Reusable schema definitions for use with `$ref`. Also supports `$defs` from newer JSON Schema drafts (automatically converted) | Takes an `object` mapping names to schemas |\n| [`$comment`](#comment) | Comment for schema maintainers (not shown to end users) | Takes a `string` |\n| [`contentEncoding`](#contentEncoding) | Encoding for string content (e.g., base64) | Takes a `string` |\n| [`contentMediaType`](#contentMediaType) | MIME type for string content | Takes a `string` |\n\n## Validation \u0026 completion\n\nTo take advantage of the generated `values.schema.json`, you can use it within your IDE through a plugin supporting the `yaml-language-server` annotation (e.g. [VSCode - YAML](https://marketplace.visualstudio.com/items?itemName=redhat.vscode-yaml))\n\nYou'll have to place this line at the top of your `values.yaml` (`$schema=\u003cpath-or-url-to-your-schema\u003e`) :\n\n```yaml\n# vim: set ft=yaml:\n# yaml-language-server: $schema=values.schema.json\n\n# @schema\n# required: true\n# @schema\n# -- This is an example description\nfoo: bar\n```\n\nYou can use the `-r` flag to make sure this line exists.\n\n\u003e [!NOTE]\n\u003e You can also point to an online available schema, if you upload a version of yours and want other to be able to implement it.\n\u003e\n\u003e `yaml-language-server: $schema=https://example.org/my-json-schema.json`\n\u003e\n\u003e e.g. from github `https://raw.githubusercontent.com/\u003cuser\u003e/\u003crepo\u003e/main/values.schema.json`\n\n### helm-docs\n\nIf you're using [`helm-docs`](https://github.com/norwoodj/helm-docs), then you can combine both annotations and use both pre-commit hooks to automatically generate your documentation (e.g. `README.md`) alongside your `values.schema.json`.\n\nIf not provided, `title` will be the key and the `description` will be parsed from the `helm-docs` formatted comment.\n\n```yaml\n# @schema\n# type: array\n# @schema\n# -- helm-docs description here\nfoo: []\n```\n\nIf you use `-p`/`--helm-docs-compatibility-mode` flags, the `@default`, `(type)` annotations and helm-docs descriptions\nare used if detected.\n\n\u003e [!NOTE]\n\u003e Make sure to place the `@schema` annotations **before** the actual key description to avoid having it in your `helm-docs` generated table\n\n## Dependencies\n\nPer default, `helm-schema` will try to also create the schemas for the dependencies in their respective chart directory. These schemas will be merged as properties in the main schema, but the `requiredProperties` field will be nullified, otherwise you would have to always overwrite all the required fields.\n\nIf you don't want to generate `jsonschema` for chart dependencies, you can use the `-n, --no-dependencies` option to only generate the `values.schema.json` for your parent chart(s)\n\n### Library Charts\n\nWhen a dependency has `type: library` in its `Chart.yaml`, `helm-schema` will merge its schema properties directly into the parent chart's schema at the top level, rather than nesting them under the dependency name. This reflects how [Helm library charts](https://helm.sh/docs/topics/library_charts/) work in practice, where the values scope is identical to the parent chart.\n\nFor example, if you have a library chart named `common` with properties `environment` and `region`, these will appear at the top level of the parent schema alongside the parent's own properties, rather than under a `common` key.\n\n**Note:** If a library chart property has the same name as a property already defined in the parent chart, the parent's property takes precedence and a warning will be logged.\n\n### Skip Dependency Schema Validation\n\nBy default, when dependency schemas are merged into the parent chart schema, they inherit strict validation rules. This means that if you add unknown keys at the top level of a dependency's values (e.g., `subchart.unknownKey`), validation may not fail as expected.\n\nIf you want to allow additional properties in dependency schemas and ensure they are not required, you can use the `-m, --skip-dependencies-schema-validation` flag. This will:\n\n1. Set `additionalProperties: true` for all dependency schemas in the parent chart\n2. Remove dependency names from the parent chart's required properties list\n\nExample usage:\n\n```sh\nhelm-schema -m\n```\n\nThis is useful when you have umbrella charts with multiple dependencies and want to allow flexibility in overriding dependency values without strict schema validation.\n\n### Handling Circular Dependencies\n\nIn some scenarios, you may have charts that reference each other to share values, creating circular dependencies. For example:\n\n- A cert-manager chart depends on a grafana chart to get the instance name for creating dashboards\n- The grafana chart depends on the cert-manager chart to get the ACME issuer value\n\nBy default, `helm-schema` will detect this as a circular dependency and log a warning. The tool will still continue processing, but the results may not be sorted in dependency order.\n\nIf you want to explicitly allow circular dependencies and acknowledge this behavior, you can use the `-w, --allow-circular-dependencies` flag:\n\n```sh\nhelm-schema -w\n```\n\nWhen this flag is enabled, circular dependencies are treated as warnings rather than errors, and the charts are processed in their original discovery order instead of topologically sorted order.\n\n**Note:** This is primarily useful when charts have cross-dependencies purely for value sharing, not for actual build order dependencies.\n\n## Limitations\n\nYou can't change the `jsonschema` for dependencies by using `@schema` annotations on dependency config values. For example:\n\n```yaml\n# foo is a dependency chart\nfoo:\n  # You can't change the schema here, this has no effect.\n  # @schema\n  # type: number\n  # @schema\n  bar: 1\n```\n\n## Examples\n\nSome annotation examples you may want to use, to help you get started!\n\n\u003e [!NOTE]\n\u003e See how the schema behaves with live examples : [values.yaml](./examples/values.yaml)\n\nBelow a snippet to test it out, with the current options `helm-schema` will not analyze dependencies (`-n`) and will omit the `additionalProperties` (`-k`, when not explicitly defined) in the generated schema. It will start looking for `Chart.yaml` and `values.yaml` files in `examples/` (`-c`)\n\n```sh\ncd examples\nhelm-schema -n -k additionalProperties\n\n# or\n\nhelm-schema -c examples -n -k additionalProperties\n```\n\nIf you'd like to use `helm-schema` on your chart dependencies as well, you have to build and unpack them before. You'll avoid the \"missing dependency\" error message.\n\n```sh\n# go where your Chart.lock/yaml is located\ncd \u003cchart-name\u003e\n\n# build dependencies and untar them\nhelm dep build\nls charts/*.tgz |xargs -n1 tar -C charts/ -xzf\n```\n\n#### `type`\n\nIf `type` isn't specified, current value type will be used.\n\n```yaml\n# Will be parsed as 'string'\n# @schema\n# title: Some title\n# description: Some description\n# @schema\nname: foo\n\n# Will be parsed as 'boolean'\n# @schema\n# type: boolean\n# @schema\nenabled: true\n\n# You can define multiple types as an array.\n# @schema\n# type: [string, integer]\n# minimum: 0\n# @schema\ncpu: 1\n```\n\n#### Root schema annotations\n\nApply schema annotations to the root document itself. This is especially useful for setting the `additionalProperties` on the root level of the schema.\n\n```yaml\n# @schema.root\n# additionalProperties: true\n# @schema.root\n# Main application settings\napp:\n  # @schema\n  # type: string\n  # @schema\n  name: my-app\n  # @schema\n  # type: boolean\n  # @schema\n  enabled: true\n```\n\n#### `title`\n\nBy default, the `title` will be parsed from the key name. If the key is `foo`, then `title: foo`.\n\n```yaml\n# Define a custom title for the key\n# @schema\n# title: My custom title for 'foo'\n# @schema\nbar: foo\n```\n\n#### `description`\n\nYou can provide the `description` through its property or let it be parsed from your comments. If `description` is provided, the comments will not be parsed as description.\n\nIf you're implementing it alongside `helm-docs`, read [this](#helm-docs) to do it correctly.\n\n```yaml\n# This text will be used as description.\n# @schema\n# type: integer\n# minimum: 1\n# @schema\nreplica: 1\n\n# @schema\n# type: integer\n# minimum: 1\n# @schema\n# This text will be used as description.\nreplica: 1\n\n# @schema\n# type: integer\n# minimum: 1\n# description: This text will be used as description.\n# @schema\n# And not this one\nreplica: 1\n```\n\n#### `default`\n\nHelp users when using their IDE to quickly retrieve the `default` value, for example through \u003ckbd\u003eCTRL+SPACE\u003c/kbd\u003e.\n\n```yaml\n# @schema\n# default: standalone\n# enum: [standalone,cluster]\n# @schema\narchitecture: \"\"\n\n# @schema\n# type: boolean\n# default: true\n# @schema\nenabled: true\n```\n\n#### `properties`\n\nAllows user to define valid keys without defining them yet. Give the user an insight of the possible properties, their types and description.\n\nBy default, `title` for the keys defined under `properties` will inherit from the main key (e.g. here `title: env`). You need to provide `title` explicitly if you want to change it.\n\n```yaml\n# @schema\n# properties:\n#   CONFIG_PATH:\n#     title: CONFIG_PATH\n#     type: string\n#     description: The local path to the service configuration file\n#   ADMIN_EMAIL:\n#     title: ADMIN_EMAIL\n#     type: string\n#     format: idn-email\n#   API_URL:\n#     type: string\n#     format: idn-hostname\n#     description: Title will be 'env' as we do not specify it here\n# @schema\n# -- Environment variables. If you want to provide auto-completion to the user\nenv: {}\n```\n\n#### `pattern`\n\nPattern that'll be used to test the value.\n\n```yaml\n# @schema\n# pattern: ^api-key\n# @schema\n# The value have to start with the 'api-key-' prefix\napiKey: \"api-key-xxxxx\"\n```\n\n#### `format`\n\nKnown formats that the value must match. Formats available at [JSON Schema - Formats](https://json-schema.org/understanding-json-schema/reference/string.html#format).\n\n```yaml\n# @schema\n# format: idn-email\n# @schema\n# Requires a valid email format\nemail: foo@example.org\n```\n\n#### `required`\n\nBy default every property is a required property, you can disable this with `required: false` for a single key. You can also invert this behaviour with the option `helm-schema -k required`, now every property is an optional one.\n\n```yaml\n# @schema\n# required: false\n# @schema\naltName: foo\n```\n\nIt's also possible to define an array of required properties on the parent.\n\n```yaml\n# @schema\n# required: [foo]\n# @schema\naltName:\n  foo: bar\n```\n\n#### `deprecated`\n\nLet the user know if the key is deprecated, hence should be avoided.\n\n```yaml\n# @schema\n# deprecated: true\n# @schema\nsecret: foo\n```\n\n#### `items`\n\nIf you want to specify a schema for possible array values without using a default value. E.g. to define the structure of the hosts definition in an k8s ingress resource.\n\n```yaml\n# @schema\n# type: array\n# items:\n#   type: object\n#   properties:\n#     host:\n#       type: object\n#       properties:\n#         url:\n#           type: string\n#           format: idn-hostname\n# @schema\n# Will give auto-completion for the below structure\n# hosts:\n#  - name:\n#      url: my.example.org\nhosts: []\n```\n\n#### `enum`\n\nAllows user to define available values for a given key. Validation will fail and error shown if you try to put another value.\n\n```yaml\n# @schema\n# enum:\n# - application\n# - controller\n# - api\n# @schema\n# Only those three values are accepted\ntype: application\n\n# @schema\n# type: array\n# items:\n#   enum: [api,frontend,backend,microservice,teamA,teamB,us-west-1,us-west-2]\n# @schema\n# For each array index, only one of those values are accepted\ntags:\n  - \"api\"\n  - \"teamA\"\n  - \"us-west-2\"\n```\n\n#### `const`\n\nDefines a constant value which shouldn't be changed.\n\n```yaml\n# @schema\n# const: maintainer@example.org\n# @schema\nmaintainer: maintainer@example.org\n```\n\n#### `examples`\n\nProvides example values to the user when hovering the key in IDE, or by auto-completion mechanism.\n\n```yaml\n# @schema\n# format: ipv4\n# examples: [192.168.0.1]\n# @schema\nclusterIP: \"\"\n\n# @schema\n# properties:\n#   CONFIG_PATH:\n#     type: string\n#     description: The local path to the service configuration file\n#     examples: [/path/to/config]\n#   ADMIN_EMAIL:\n#     type: string\n#     format: idn-email\n#     examples: [admin@example.org]\n#   API_URL:\n#     type: string\n#     format: idn-hostname\n#     examples: [https://api.example.org]\n# @schema\n# -- Provide auto-completion and examples to the user\nenv: {}\n```\n\n#### `minimum`\n\nThe value have to be above or equal the given `integer`.\n\n```yaml\n# @schema\n# minimum: 1\n# @schema\nreplica: \"\"\n```\n\n#### `exclusiveMinimum`\n\nThe value have to be strictly above the given `integer`.\n\n```yaml\n# @schema\n# exclusiveMinimum: 0\n# @schema\nreplica: \"\"\n```\n\n#### `maximum`\n\nThe value have to be below or equal the given `integer`.\n\n```yaml\n# @schema\n# maximum: 10\n# @schema\nreplica: \"\"\n```\n\n#### `exclusiveMaximum`\n\nThe value have to be strictly below the given `integer`.\n\n```yaml\n# @schema\n# exclusiveMaximum: 5\n# @schema\ncpu: \"\"\n```\n\n#### `multipleOf`\n\nThe value have to be a multiple of the given `integer`.\n\n```yaml\n# @schema\n# multipleOf: 1024\n# @schema\nstorageCapacity: 2048\n```\n\n#### `additionalProperties`\n\nBy default, `additionalProperties` is set to `false` unless you use the `-k additionalProperties` option. Useful when you don't know what nested keys you'll have.\n\n```yaml\n# @schema\n# additionalProperties: true\n# @schema\n# You'll be able to add as many keys below `env:` as you want without invalidating the schema\nenv:\n  LONG: foo\n  LIST: bar\n  OF: baz\n  VARIABLES: bat\n\n# @schema\n# additionalProperties: true\n# properties:\n#   REQUIRED_VAR:\n#     type: string\n# @schema\nenv:\n  REQUIRED_VAR: foo\n  OPTIONAL_VAR: bar\n```\n\n#### `patternProperties`\n\nMapping schemas to key name patterns. If properties match the patterns, the given schema is applied.\n\nUseful when you work with a long list of keys and want to define a common schema for a group of them, for example.\n\nE.g. `patternProperties.\"^API_.*\"` key defines the pattern whose schema will be applied on any user provided key that match that pattern.\n\n```yaml\n# @schema\n# type: object\n# patternProperties:\n#   \"^API_.*\":\n#     type: string\n#     pattern: ^api-key\n#   \"^EMAIL_.*\":\n#     type: string\n#     format: idn-email\n# @schema\nenv:\n  API_PROVIDER_ONE: api-key-xxxxx\n  API_PROVIDER_TWO: api-key-xxxxx\n  EMAIL_ADMIN: admin@example.org\n  EMAIL_DEFAULT_USER: user@example.org\n```\n\n#### `anyOf`\n\nAllows user to define multiple schema fo a single key. Key can be `anyOf` the given schemas or none of them.\n\n```yaml\n# Accepts multiple types\n# @schema\n# anyOf:\n#   - type: string\n#   - type: integer\n# minimum: 0\n# @schema\nfoot: 1\n\n# The above can be simplified with `type:`\n# @schema\n# type: [string, integer]\n# minimum: 0\n# @schema\nfool: 1\n\n# A pattern is also possible.\n# In this case null or some string starting with foo.\n# @schema\n# anyOf:\n#   - type: \"null\"\n#   - pattern: ^foo\n# @schema\nbar:\n```\n\n#### `oneOf`\n\nAllows user to define multiple schema fo a single key. Key must match `oneOf` the given schemas.\n\n```yaml\n# @schema\n# oneOf:\n#   - type: integer\n#   - pattern: Gib$\n#   - pattern: gib$\n# @schema\nstorage: 30Gib\n```\n\n#### `allOf`\n\nAllows user to define multiple schema for a single key. Key must match `oneOf` the given schemas.\n\n```yaml\n# @schema\n# allOf:\n#   - type: string\n#     pattern: Gib$\n#   - enum: [5Gib,10Gib,15Gib]\n# @schema\nstorage: 10Gib\n```\n\n#### `not`\n\nAllows to define a schema that must not be matched.\n\n```yaml\n# @schema\n# not:\n#   type: string\n# @schema\nfoo: bar\n```\n\n#### `if/then/else`\n\nConditional schema settings with `if`/`then`/`else`\n\n```yaml\n# @schema\n# anyOf:\n#   - type: \"null\"\n#   - type: string\n# if:\n#   type: \"null\"\n# then:\n#   description: It's a null value\n# else:\n#   description: It's a string\n# @schema\nunknown: foo\n```\n\n#### `minLength`\n\nThe value must be an integer greater or equal to zero and defines the minimum length of a string value.\n\n```yaml\n# @schema\n# minLength: 1\n# @schema\nnamespace: foo\n```\n\n#### `maxLength`\n\nThe value must be an integer greater than zero and defines the maximum length of a string value.\n\n```yaml\n# @schema\n# maxLength: 3\n# @schema\nnamespace: foo\n```\n\n#### `minItems`\n\nThe value must be an integer greater than zero and defines the minimum length of an array value.\n\n```yaml\n# @schema\n# minItems: 1\n# @schema\nnamespace:\n  - foo\n```\n\n#### `maxItems`\n\nThe value must be an integer greater than zero and defines the maximum length of an array value.\n\n```yaml\n# @schema\n# maxItems: 2\n# @schema\nnamespace:\n  - foo\n  - bar\n```\n\n#### `uniqueItems`\n\nA schema can ensure that each of the items in an array is unique. Simply set the uniqueItems keyword to true.\n\n```yaml\n# @schema\n# uniqueItems: true\n# @schema\nnamespace:\n  - foo\n  - bar\n```\n\n#### `$ref`\n\nThe value must be an URI or relative file.\n\nRelative files are imported on creation time. If you update the referenced file, you need\nto run helm-schema again.\n\n**foo.json:**\n\n```json\n{\n  \"foo\": {\n    \"type\": \"string\",\n    \"minLength\": 10\n  }\n}\n```\n\n```yaml\n# @schema\n# $ref: foo.json#/foo\n# @schema\nnamespace: foo\n```\n\nis the same as\n\n```yaml\n# @schema\n# type: string\n# minLength: 10\n# @schema\nnamespace: foo\n```\n\n#### `contains`\n\nSpecifies that an array must contain at least one item matching the given schema.\n\n```yaml\n# @schema\n# type: array\n# contains:\n#   type: string\n#   pattern: ^admin\n# @schema\n# At least one item must be a string starting with 'admin'\nusers:\n  - admin-user\n  - regular-user\n```\n\n#### `additionalItems`\n\nControls validation of array items beyond those specified in an `items` tuple.\n\n```yaml\n# @schema\n# type: array\n# additionalItems: false\n# @schema\n# No additional items allowed beyond what's defined\nfixedArray:\n  - foo\n  - bar\n```\n\n#### `minProperties`\n\nMinimum number of properties an object must have.\n\n```yaml\n# @schema\n# type: object\n# minProperties: 1\n# @schema\n# Object must have at least one property\nconfig: {}\n```\n\n#### `maxProperties`\n\nMaximum number of properties an object can have.\n\n```yaml\n# @schema\n# type: object\n# maxProperties: 5\n# @schema\n# Object can have at most 5 properties\nlabels:\n  app: myapp\n  env: prod\n```\n\n#### `propertyNames`\n\nSchema that all property names in an object must match.\n\n```yaml\n# @schema\n# type: object\n# propertyNames:\n#   pattern: ^[a-z][a-z0-9-]*$\n# @schema\n# All property names must be lowercase with hyphens\nannotations:\n  app-name: myapp\n  version: v1\n```\n\n#### `dependencies`\n\nDefine property dependencies - when one property is present, others must be too.\n\n```yaml\n# @schema\n# type: object\n# dependencies:\n#   creditCard: [billingAddress]\n#   billingAddress: [creditCard]\n# @schema\n# If creditCard is present, billingAddress must also be present\npayment:\n  creditCard: \"1234-5678\"\n  billingAddress: \"123 Main St\"\n```\n\n#### `definitions`\n\nDefine reusable schema fragments that can be referenced with `$ref`.\n\n\u003e [!NOTE]\n\u003e When referencing external JSON Schema files that use `$defs` (JSON Schema Draft 2019-09+), helm-schema automatically converts them to `definitions` and rewrites `$ref` paths from `#/$defs/` to `#/definitions/` for Draft 7 compatibility.\n\n```yaml\n# @schema\n# definitions:\n#   port:\n#     type: integer\n#     minimum: 1\n#     maximum: 65535\n# properties:\n#   httpPort:\n#     $ref: \"#/definitions/port\"\n#   httpsPort:\n#     $ref: \"#/definitions/port\"\n# @schema\nservice:\n  httpPort: 80\n  httpsPort: 443\n```\n\n#### `$comment`\n\nAdd comments for schema maintainers that won't be shown to end users.\n\n```yaml\n# @schema\n# type: string\n# $comment: This field is deprecated and will be removed in v2.0\n# @schema\nlegacyField: foo\n```\n\n#### `contentEncoding`\n\nSpecify the encoding for string content, such as base64.\n\n```yaml\n# @schema\n# type: string\n# contentEncoding: base64\n# @schema\n# Value is expected to be base64 encoded\ncertificate: \"LS0tLS1CRUdJTi...\"\n```\n\n#### `contentMediaType`\n\nSpecify the MIME type for string content.\n\n```yaml\n# @schema\n# type: string\n# contentMediaType: application/json\n# contentEncoding: base64\n# @schema\n# Value is base64-encoded JSON\nconfigData: \"eyJmb28iOiAiYmFyIn0=\"\n```\n\n## License\n\n[MIT](https://github.com/dadav/helm-schema/blob/main/LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdadav%2Fhelm-schema","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdadav%2Fhelm-schema","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdadav%2Fhelm-schema/lists"}