{
  "$defs": {
    "InputDeclaration": {
      "additionalProperties": false,
      "description": "One typed input a Release declares. Templates read its effective value as `inputs.<name>`.",
      "properties": {
        "default": {
          "description": "Value used when the target binds none. Makes the input optional; must satisfy `type` and `enum`."
        },
        "description": {
          "description": "Documentation, surfaced in errors and inspection.",
          "type": [
            "string",
            "null"
          ]
        },
        "enum": {
          "description": "Allowed values, for scalar types only. A non-empty list of values of the declared type.",
          "items": true,
          "type": [
            "array",
            "null"
          ]
        },
        "type": {
          "$ref": "#/$defs/InputType",
          "description": "Value type: `string`, `integer`, `number`, `boolean`, `object`, or `array`."
        }
      },
      "required": [
        "type"
      ],
      "type": "object"
    },
    "InputType": {
      "description": "Declared input type. Every type is a subset of JSON Schema.",
      "oneOf": [
        {
          "const": "string",
          "description": "A JSON string.",
          "type": "string"
        },
        {
          "const": "integer",
          "description": "A JSON integer; numbers with a fractional part are rejected.",
          "type": "string"
        },
        {
          "const": "number",
          "description": "Any JSON number.",
          "type": "string"
        },
        {
          "const": "boolean",
          "description": "`true` or `false`.",
          "type": "string"
        },
        {
          "const": "object",
          "description": "A JSON object. Only the top-level type is checked.",
          "type": "string"
        },
        {
          "const": "array",
          "description": "A JSON array. Only the top-level type is checked.",
          "type": "string"
        }
      ]
    },
    "ReleaseArgoCdSpec": {
      "additionalProperties": false,
      "description": "ArgoCD-specific options for Release.",
      "properties": {
        "applicationOverride": {
          "additionalProperties": true,
          "description": "Optional partial ArgoCD Application override.\n\nMust be an object if provided.",
          "type": [
            "object",
            "null"
          ]
        }
      },
      "type": "object"
    },
    "ReleaseMetadata": {
      "additionalProperties": false,
      "description": "Metadata for Release",
      "properties": {
        "name": {
          "description": "Release name",
          "type": "string"
        },
        "namespace": {
          "description": "Target namespace for the release",
          "type": "string"
        }
      },
      "required": [
        "name",
        "namespace"
      ],
      "type": "object"
    },
    "ReleaseSpec": {
      "additionalProperties": false,
      "description": "Rendering and GitOps options for a Release.",
      "properties": {
        "additionalNamespaces": {
          "description": "Additional namespaces that rendered resources may explicitly target.",
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "argocd": {
          "anyOf": [
            {
              "$ref": "#/$defs/ReleaseArgoCdSpec"
            },
            {
              "type": "null"
            }
          ],
          "description": "ArgoCD-specific options."
        },
        "include": {
          "description": "Additional manifest files, resolved relative to the Release file.",
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "inputs": {
          "additionalProperties": {
            "$ref": "#/$defs/InputDeclaration"
          },
          "description": "Typed inputs, read by templates as `inputs.<name>` and bound per target in `DeploymentTarget.spec.releaseInputs`. A Release that declares inputs needs a literal `metadata.name` and a literal `spec.inputs` block.",
          "type": "object"
        },
        "stripEmptyMetadataLabels": {
          "anyOf": [
            {
              "$ref": "#/$defs/StripEmptyMetadataLabelsMode"
            },
            {
              "type": "null"
            }
          ],
          "description": "Control when empty `metadata.labels` maps are stripped from emitted manifests."
        }
      },
      "type": "object"
    },
    "StripEmptyMetadataLabelsMode": {
      "description": "Controls when empty `metadata.labels` maps are stripped from emitted manifests.",
      "oneOf": [
        {
          "const": "always",
          "description": "Always strip empty `metadata.labels` maps from emitted manifests.",
          "type": "string"
        },
        {
          "const": "never",
          "description": "Never strip empty `metadata.labels` maps from emitted manifests.",
          "type": "string"
        },
        {
          "const": "argocd",
          "description": "Strip empty `metadata.labels` maps only when running in an ArgoCD environment.",
          "type": "string"
        }
      ]
    }
  },
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "additionalProperties": false,
  "description": "Defines a Kubernetes workload manifest boundary and its permitted namespace scope.\n\nNyl extracts this metadata from the output. Included files belong to this Release and cannot declare another Release. GitOps uses the boundary to generate one workload Application.\n\n## When needed\n\nRequired in each workload entry file discovered through an ApplicationGroup. Files included by `spec.include` belong to that Release and must not declare another one.\n\n## If omitted\n\nApplicationGroup discovery ignores candidate files without a literal Release document. Direct `nyl render` can render without one; direct `nyl apply` and `nyl diff` require `--name` and `--namespace` when no Release supplies them.",
  "examples": [
    {
      "apiVersion": "k8s.nyl/v1",
      "kind": "Release",
      "metadata": {
        "name": "workloads",
        "namespace": "workloads"
      },
      "spec": {
        "include": [
          "manifests/*.yaml"
        ]
      }
    }
  ],
  "properties": {
    "apiVersion": {
      "const": "k8s.nyl/v1",
      "description": "API group and version defining this resource.",
      "type": "string"
    },
    "kind": {
      "const": "Release",
      "description": "Resource kind within the API group.",
      "type": "string"
    },
    "metadata": {
      "$ref": "#/$defs/ReleaseMetadata",
      "description": "Resource identity and metadata."
    },
    "spec": {
      "$ref": "#/$defs/ReleaseSpec",
      "default": {},
      "description": "Configuration for this resource."
    }
  },
  "required": [
    "apiVersion",
    "kind",
    "metadata"
  ],
  "title": "Release",
  "type": "object"
}
