{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "environmentVariables": {
      "maxItems": 50,
      "type": "array",
      "items": {
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "key": {
                "type": "string",
                "minLength": 1,
                "maxLength": 64,
                "pattern": "^[A-Z_][A-Z0-9_]*$"
              },
              "source": {
                "type": "string",
                "const": "inline"
              },
              "value": {
                "type": "string",
                "maxLength": 8192
              },
              "targets": {
                "minItems": 1,
                "maxItems": 2,
                "type": "array",
                "items": {
                  "type": "string",
                  "enum": [
                    "setup",
                    "harness"
                  ]
                }
              }
            },
            "required": [
              "key",
              "source",
              "value",
              "targets"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "key": {
                "type": "string",
                "minLength": 1,
                "maxLength": 64,
                "pattern": "^[A-Z_][A-Z0-9_]*$"
              },
              "source": {
                "type": "string",
                "const": "managed"
              },
              "secretName": {
                "type": "string",
                "minLength": 1,
                "maxLength": 64,
                "pattern": "^[A-Za-z0-9_-]+$"
              },
              "targets": {
                "minItems": 1,
                "maxItems": 2,
                "type": "array",
                "items": {
                  "type": "string",
                  "enum": [
                    "setup",
                    "harness"
                  ]
                }
              }
            },
            "required": [
              "key",
              "source",
              "secretName",
              "targets"
            ],
            "additionalProperties": false
          }
        ]
      }
    }
  },
  "required": [
    "environmentVariables"
  ],
  "additionalProperties": false
}
