{
  "$comment": "SPDX-License-Identifier: MIT",
  "$id": "https://spec.vaultfire.local/v3-open/1.0.0/error-envelope.v1.schema.json",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "additionalProperties": false,
  "properties": {
    "code": {
      "pattern": "^VF3-[A-Z]+-[0-9]{3}$",
      "type": "string"
    },
    "context": {
      "additionalProperties": {
        "type": [
          "string",
          "boolean",
          "null"
        ]
      },
      "maxProperties": 16,
      "propertyNames": {
        "pattern": "^[a-z][A-Za-z0-9]{0,63}$",
        "type": "string"
      },
      "type": "object"
    },
    "message": {
      "maxLength": 512,
      "minLength": 1,
      "type": "string"
    },
    "protocolVersion": {
      "const": "3.0.0"
    },
    "retryable": {
      "type": "boolean"
    },
    "schema": {
      "const": "vaultfire.v3.open.error.v1"
    },
    "schemaVersion": {
      "const": "1.0.0"
    },
    "title": {
      "maxLength": 128,
      "minLength": 1,
      "type": "string"
    },
    "truth": {
      "additionalProperties": false,
      "properties": {
        "audited": {
          "type": "boolean"
        },
        "authorized": {
          "type": "boolean"
        },
        "deployed": {
          "type": "boolean"
        },
        "endorsed": {
          "type": "boolean"
        },
        "specificationCompliant": {
          "type": "boolean"
        }
      },
      "required": [
        "specificationCompliant",
        "audited",
        "deployed",
        "authorized",
        "endorsed"
      ],
      "type": "object"
    }
  },
  "required": [
    "schema",
    "schemaVersion",
    "protocolVersion",
    "code",
    "title",
    "message",
    "retryable",
    "context",
    "truth"
  ],
  "type": "object"
}
