{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "urn:openbooks:schema:v1:refusal",
  "title": "OpenBooksRefusal",
  "type": "object",
  "required": [
    "schema_version",
    "status",
    "data",
    "error"
  ],
  "additionalProperties": false,
  "properties": {
    "schema_version": {
      "const": "openbooks.v1"
    },
    "status": {
      "const": "refused"
    },
    "data": {
      "type": "null"
    },
    "error": {
      "type": "object",
      "required": [
        "code",
        "message",
        "file_sha256"
      ],
      "additionalProperties": false,
      "properties": {
        "code": {
          "type": "string",
          "pattern": "^[A-Z][A-Z_]+$"
        },
        "message": {
          "type": "string"
        },
        "internal": {
          "type": "boolean"
        },
        "file_sha256": {
          "type": "string",
          "pattern": "^[0-9a-f]{64}$"
        }
      }
    }
  }
}
