{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://ledger.abivia.com/api/json/reference-response.schema.json",
  "title": "Reference Response",
  "description": "Response to a Reference request",
  "type": "object",
  "oneOf": [
    {
      "properties": {
        "time": {
          "description": "The time the request was processed.",
          "type": "string",
          "pattern": "\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{6}Z"
        },
        "reference": {
          "description": "Attributes of the Reference",
          "type": "object",
          "properties": {
            "uuid": {
              "description": "A unique identifier for the reference.",
              "type": "string",
              "format": "uuid"
            },
            "code": {
              "description": "The application code to identify the reference.",
              "type": "string"
            },
            "extra": {
              "description": "Arbitrary data set by the application.",
              "type": "string"
            },
            "revision": {
              "description": "A revision hash code",
              "type": "string"
            },
            "createdAt": {
              "description": "The time the currency was created.",
              "type": "string",
              "pattern": "\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{6}Z"
            },
            "updatedAt": {
              "description": "The time the currency was updated.",
              "type": "string",
              "pattern": "\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{6}Z"
            }
          },
          "required": ["code", "createdAt", "extra", "revision", "updatedAt", "uuid"]
        }
      },
      "required": ["reference", "time"]
    },
    {
      "$ref": "https://ledger.abivia.com/api/json/success-response.schema.json"
    },
    {
      "$ref": "https://ledger.abivia.com/api/json/error-response.schema.json"
    }
  ]
}
