{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://www.aep.foundation/conformance/report.schema.json",
  "title": "AEP generated conformance report",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "report_version",
    "generated_at",
    "implementation",
    "role",
    "profiles",
    "aep_version",
    "manifest_revision",
    "vector_revision",
    "suites"
  ],
  "properties": {
    "report_version": {
      "const": "1"
    },
    "generated_at": {
      "type": "string",
      "format": "date-time"
    },
    "implementation": {
      "type": "object",
      "additionalProperties": false,
      "required": ["name", "version"],
      "properties": {
        "name": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128
        },
        "version": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128
        }
      }
    },
    "role": {
      "enum": ["agent", "service", "platform"]
    },
    "profiles": {
      "type": "array",
      "minItems": 1,
      "uniqueItems": true,
      "items": {
        "enum": [
          "core-http",
          "claims",
          "api-key",
          "basic",
          "oauth-bearer",
          "platform-hosted-identity"
        ]
      }
    },
    "aep_version": {
      "const": "1.0"
    },
    "manifest_revision": {
      "type": "string",
      "pattern": "^sha256:[a-f0-9]{64}$"
    },
    "vector_revision": {
      "type": "string",
      "pattern": "^sha256:[a-f0-9]{64}$"
    },
    "suites": {
      "type": "array",
      "minItems": 1,
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": ["category", "profile", "passed", "failed", "skipped"],
        "properties": {
          "category": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          },
          "profile": {
            "enum": [
              "core-http",
              "claims",
              "api-key",
              "basic",
              "oauth-bearer",
              "platform-hosted-identity"
            ]
          },
          "passed": {
            "type": "integer",
            "minimum": 0
          },
          "failed": {
            "type": "integer",
            "minimum": 0
          },
          "skipped": {
            "type": "integer",
            "minimum": 0
          }
        }
      }
    }
  },
  "allOf": [
    {
      "if": {
        "properties": {
          "role": { "const": "platform" }
        }
      },
      "then": {
        "properties": {
          "profiles": {
            "const": ["platform-hosted-identity"]
          }
        }
      },
      "else": {
        "properties": {
          "profiles": {
            "contains": { "const": "core-http" }
          }
        }
      }
    }
  ]
}
