{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "scope": {
      "type": "string",
      "enum": [
        "org",
        "project",
        "app"
      ]
    },
    "scopeId": {
      "type": "string",
      "minLength": 1,
      "maxLength": 12,
      "pattern": "^[A-Za-z0-9_-]+$"
    },
    "scopeName": {
      "type": "string",
      "minLength": 1
    },
    "projects": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 12,
            "pattern": "^[A-Za-z0-9_-]+$"
          },
          "slug": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "name": {
            "type": "string",
            "minLength": 1
          },
          "apps": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 12,
                  "pattern": "^[A-Za-z0-9_-]+$"
                },
                "name": {
                  "type": "string",
                  "minLength": 1
                },
                "domain": {
                  "type": "string"
                }
              },
              "required": [
                "id",
                "name",
                "domain"
              ],
              "additionalProperties": false
            }
          }
        },
        "required": [
          "id",
          "slug",
          "name",
          "apps"
        ],
        "additionalProperties": false
      }
    }
  },
  "required": [
    "scope",
    "scopeId",
    "scopeName",
    "projects"
  ],
  "additionalProperties": false
}
