{
  "$defs": {
    "ChartRef": {
      "additionalProperties": false,
      "description": "Reference to a Helm chart\n\nSupports Git, OCI, traditional Helm repositories, and local filesystem paths",
      "properties": {
        "name": {
          "description": "Universal name field with context-dependent meaning\n\nWhen `repository` is set:\n- For Helm/OCI repositories: Specifies the chart name (required)\n- For Git repositories: Specifies subdirectory path within repo (optional)\n\nWhen `repository` is NOT set:\n- Treated as local filesystem path (absolute or relative)\n\nExamples:\n- Local filesystem: \"./charts/mychart\", \"/opt/charts/app\"\n- Git subpath: \"charts/mychart\", \"deploy/helm/app\"\n- Helm/OCI chart: \"nginx\", \"prometheus\"",
          "type": [
            "string",
            "null"
          ]
        },
        "repository": {
          "description": "Repository URL for Git, OCI, or traditional Helm repositories\n\nProtocol prefixes indicate the repository type:\n- `git+https://` or `git+git@` - Git repository\n- `oci://` - OCI registry\n- `https://` or no prefix - Traditional Helm repository\n\nExamples:\n- Git: \"git+https://github.com/user/repo.git\"\n- Git SSH: \"git+git@github.com:user/repo.git\"\n- OCI: \"oci://ghcr.io/owner/chart\"\n- Helm: \"https://charts.example.com\"",
          "type": [
            "string",
            "null"
          ]
        },
        "version": {
          "description": "Chart version or Git reference\n\nFor Helm repositories: Specifies the chart version (required)\nFor Git repositories: Specifies the Git reference - branch, tag, or commit\n                      (optional, defaults to HEAD)\n\nExamples:\n- Branch: \"main\", \"develop\"\n- Tag: \"v1.0.0\", \"1.2.3\"\n- Commit: \"abc123...\" (full or short hash)",
          "type": [
            "string",
            "null"
          ]
        }
      },
      "type": "object"
    },
    "HelmChartSpec": {
      "additionalProperties": false,
      "description": "HelmChart specification",
      "properties": {
        "chart": {
          "$ref": "#/$defs/ChartRef",
          "description": "Reference to the chart"
        },
        "includeCrds": {
          "description": "Whether to include CRDs from the chart's crds/ directory in the rendered output.\nDefaults to true when unset.",
          "type": [
            "boolean",
            "null"
          ]
        },
        "values": {
          "default": null,
          "description": "Values to pass to the chart"
        }
      },
      "required": [
        "chart"
      ],
      "type": "object"
    },
    "ObjectMetadata": {
      "additionalProperties": false,
      "description": "Kubernetes object metadata",
      "properties": {
        "annotations": {
          "additionalProperties": {
            "type": "string"
          },
          "description": "Annotations",
          "type": "object"
        },
        "labels": {
          "additionalProperties": {
            "type": "string"
          },
          "description": "Labels",
          "type": "object"
        },
        "name": {
          "description": "Resource name",
          "type": "string"
        },
        "namespace": {
          "description": "Namespace (optional)",
          "type": [
            "string",
            "null"
          ]
        }
      },
      "required": [
        "name"
      ],
      "type": "object"
    }
  },
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "additionalProperties": false,
  "description": "Expands a local or remote Helm chart into Kubernetes manifests.\n\nNyl renders the chart and recursively processes its output. Cluster and target values are template inputs; pass values to the chart explicitly through `spec.values`.\n\n## When needed\n\nUse this optional resource to render a Helm chart with explicit chart coordinates and values.\n\n## If omitted\n\nNyl does not discover and render charts automatically. Invoke charts through a HelmChart or a component resource; projects containing only authored Kubernetes manifests need neither.",
  "examples": [
    {
      "apiVersion": "k8s.nyl/v1",
      "kind": "HelmChart",
      "metadata": {
        "name": "workloads",
        "namespace": "workloads"
      },
      "spec": {
        "chart": {
          "name": "./charts/app"
        },
        "values": {
          "replicaCount": 2
        }
      }
    }
  ],
  "properties": {
    "apiVersion": {
      "const": "k8s.nyl/v1",
      "description": "API version (e.g., \"k8s.nyl/v1\")",
      "type": "string"
    },
    "kind": {
      "const": "HelmChart",
      "description": "Resource kind (always \"HelmChart\")",
      "type": "string"
    },
    "metadata": {
      "$ref": "#/$defs/ObjectMetadata",
      "description": "Kubernetes metadata"
    },
    "spec": {
      "$ref": "#/$defs/HelmChartSpec",
      "description": "Chart specification"
    }
  },
  "required": [
    "apiVersion",
    "kind",
    "metadata",
    "spec"
  ],
  "title": "HelmChart",
  "type": "object"
}
