{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "title": "NCC Hub Configuration",
  "description": "Schema for an NCC Hub YAML configuration file.",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "name",
    "project_id"
  ],
  "properties": {
    "name": {
      "type": "string",
      "description": "The name of the NCC hub."
    },
    "project_id": {
      "type": "string",
      "description": "The project ID where the hub will be created."
    },
    "description": {
      "type": "string",
      "description": "An optional description for the hub."
    },
    "export_psc": {
      "type": "boolean",
      "description": "Whether to export PSC routes to other spokes."
    },
    "preset_topology": {
      "type": "string",
      "description": "The preset topology for the hub."
    },
    "groups": {
      "$ref": "#/$defs/groups"
    }
  },
  "$defs": {
    "groups": {
      "type": "object",
      "description": "A map of NCC groups to be created in the hub.",
      "additionalProperties": false,
      "patternProperties": {
        "^[a-zA-Z0-9_-]+$": {
          "$ref": "#/$defs/group"
        }
      }
    },
    "group": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "description": {
          "type": "string",
          "description": "An optional description for the group."
        },
        "labels": {
          "type": "object",
          "description": "Labels to apply to the group."
        },
        "auto_accept": {
          "type": "array",
          "description": "A list of project IDs to auto-accept for group membership.",
          "items": {
            "type": "string"
          }
        }
      }
    }
  }
}
