{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://www.aep.foundation/schemas/platform-sign-response.schema.json",
  "title": "AEP Platform Sign Response",
  "oneOf": [
    {
      "type": "object",
      "required": ["status", "agent_did", "client_assertion", "expires_at", "issued_at", "jti", "service_did"],
      "additionalProperties": true,
      "properties": {
        "status": { "const": "completed" },
        "platform_context": { "type": "object" },
    "agent_did": {
      "type": "string",
      "pattern": "^did:"
    },
    "client_assertion": {
      "type": "string",
      "minLength": 1
    },
    "expires_at": {
      "type": "string",
      "format": "date-time"
    },
    "issued_at": {
      "type": "string",
      "format": "date-time"
    },
    "jti": {
      "type": "string",
      "minLength": 1
    },
        "service_did": {
      "type": "string",
      "pattern": "^did:"
        }
      }
    },
    {
      "type": "object",
      "required": ["status", "retry_after_seconds"],
      "additionalProperties": true,
      "properties": {
        "status": { "const": "pending" },
        "platform_context": { "type": "object" },
        "retry_after_seconds": {
          "type": "string",
          "pattern": "^(?:[1-9]|[1-9][0-9]|[12][0-9]{2}|300)$"
        }
      }
    }
  ]
}
