{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://catalog.lintel.tools/schemas/schemastore/dolittle-event-horizons-configuration/latest.json",
  "title": "Event Horizons Configuration",
  "description": "The event horizons configuration",
  "x-lintel": {
    "source": "https://raw.githubusercontent.com/dolittle/Runtime/master/Schemas/Events/event-horizons.json",
    "sourceSha256": "b5a4ee6a61c0abf25d5def3634764e73ef26a6ace1cc90daa125444ad0fb978c",
    "fileMatch": [
      "**/.dolittle/event-horizons.json"
    ],
    "parsers": [
      "json"
    ]
  },
  "type": "array",
  "items": {
    "$ref": "#/$defs/eventHorizonConfiguration"
  },
  "$defs": {
    "eventHorizonConfiguration": {
      "description": "The configuration of an event horizon",
      "type": "object",
      "properties": {
        "application": {
          "description": "The application id of the application which the bounded context you want to communicate belongs to",
          "type": "string"
        },
        "boundedContext": {
          "description": "The bounded context id you wish to penetrate to",
          "type": "string"
        },
        "url": {
          "description": "The url where the other bounded context's event horizon lives",
          "type": "string",
          "format": "uri-reference"
        },
        "events": {
          "description": "An array of event artifacts that this bounded context is interested in",
          "type": "array",
          "items": {
            "$ref": "#/$defs/artifact"
          }
        }
      },
      "required": [
        "application",
        "boundedContext",
        "url",
        "events"
      ]
    },
    "artifact": {
      "$comment": "Should become it's own schema file'",
      "description": "The configuration of an artifact",
      "properties": {
        "id": {
          "description": "The artifact id",
          "type": "string"
        },
        "generation": {
          "description": "The artifact generation",
          "type": "number"
        }
      },
      "required": [
        "id",
        "generation"
      ],
      "type": "object"
    }
  }
}
