{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://www.aep.foundation/schemas/inspect-document.schema.json",
  "title": "AEP Inspect Document",
  "type": "object",
  "required": ["aep_version", "bindings", "commands", "core", "http", "identity", "service"],
  "additionalProperties": true,
  "properties": {
    "aep_version": {
      "type": "string",
      "pattern": "^[0-9]+\\.[0-9]+$"
    },
    "authentication": {
      "type": "object",
      "required": ["methods"],
      "additionalProperties": false,
      "properties": {
        "methods": {
          "type": "array",
          "minItems": 1,
          "maxItems": 16,
          "uniqueItems": true,
          "items": {
            "type": "string",
            "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"
          }
        }
      }
    },
    "bindings": {
      "type": "object",
      "required": ["supported"],
      "additionalProperties": true,
      "properties": {
        "supported": {
          "type": "array",
          "minItems": 1,
          "items": {
            "type": "string",
            "enum": ["http"]
          }
        }
      }
    },
    "claims": {
      "type": "object",
      "additionalProperties": true,
      "properties": {
        "required": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "preferred": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "optional": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      }
    },
    "commands": {
      "type": "object",
      "required": ["supported"],
      "additionalProperties": true,
      "properties": {
        "supported": {
          "type": "array",
          "minItems": 1,
          "items": {
            "type": "string",
            "enum": ["inspect", "enroll", "grant", "revoke", "status"]
          }
        },
        "grant_types": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      }
    },
    "core": {
      "type": "object",
      "additionalProperties": true,
      "properties": {
        "signing_algorithms": {
          "type": "array",
          "minItems": 1,
          "items": {
            "type": "string"
          }
        }
      }
    },
    "extensions": {
      "type": "object",
      "additionalProperties": true,
      "properties": {
        "supported": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      }
    },
    "http": {
      "type": "object",
      "required": ["endpoint_base"],
      "additionalProperties": true,
      "properties": {
        "endpoint_base": {
          "type": "string",
          "pattern": "^/"
        },
        "openapi": {
          "type": "object",
          "required": ["url", "path_matching"],
          "additionalProperties": false,
          "properties": {
            "url": {
              "type": "string",
              "minLength": 1
            },
            "path_matching": {
              "type": "object",
              "required": ["trailing_slash"],
              "additionalProperties": false,
              "properties": {
                "trailing_slash": {
                  "type": "string",
                  "enum": ["strict", "equivalent"]
                }
              }
            }
          }
        }
      }
    },
    "identity": {
      "type": "object",
      "required": ["methods"],
      "additionalProperties": true,
      "properties": {
        "methods": {
          "type": "array",
          "minItems": 1,
          "items": {
            "type": "string",
            "pattern": "^[a-z0-9]+(?::[a-z0-9]+)*(?:-[a-z0-9]+)*$"
          }
        }
      }
    },
    "service": {
      "type": "object",
      "required": ["did"],
      "additionalProperties": true,
      "properties": {
        "did": {
          "type": "string",
          "pattern": "^did:"
        }
      }
    }
  }
}
