{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://docs.horusbi.com.br/schemas/v2/variables.schema.json",
  "title": "Lumo v2 variables YAML",
  "type": "object",
  "required": [
    "header",
    "body"
  ],
  "properties": {
    "fileName": {
      "$ref": "shared.schema.json#/$defs/variablesFileName"
    },
    "header": {
      "allOf": [
        {
          "$ref": "shared.schema.json#/$defs/resourceHeaderBase"
        },
        {
          "type": "object",
          "not": {
            "required": [
              "id"
            ]
          },
          "properties": {
            "kind": {
              "const": "variables"
            }
          }
        }
      ]
    },
    "body": {
      "type": "object",
      "required": [
        "items"
      ],
      "properties": {
        "items": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "key",
              "is_secret"
            ],
            "properties": {
              "key": {
                "type": "string",
                "pattern": "^[A-Z_][A-Z0-9_]*$"
              },
              "value": {
                "type": "string",
                "description": "Editable when present; omitted or placeholder for secret variables on GET/self-healed YAML."
              },
              "is_secret": {
                "type": "boolean"
              },
              "description": {
                "type": [
                  "string",
                  "null"
                ]
              }
            },
            "additionalProperties": true
          }
        }
      },
      "additionalProperties": true
    }
  },
  "additionalProperties": false
}
