{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://catalog.lintel.tools/schemas/schemastore/dolittle-bounded-context-configuration/latest.json",
  "title": "Bounded Context Configuration",
  "description": "The bounded context configuration",
  "x-lintel": {
    "source": "https://raw.githubusercontent.com/dolittle/Runtime/master/Schemas/Applications.Configuration/bounded-context.json",
    "sourceSha256": "452773bd07c042673edd7fe6da828eca90ba4478797dcb11f6c5f37299ab4fbc",
    "fileMatch": [
      "bounded-context.json"
    ],
    "parsers": [
      "json"
    ]
  },
  "type": "object",
  "properties": {
    "application": {
      "description": "The application id that represents the application that this bounded context is a part of",
      "type": "string"
    },
    "boundedContext": {
      "description": "The bounded context id that represents this bounded context",
      "type": "string"
    },
    "boundedContextName": {
      "description": "The bounded context name that represents the name of this bounded context",
      "type": "string"
    },
    "core": {
      "$ref": "#/$defs/coreConfiguration"
    },
    "interaction": {
      "description": "A list of configurations for the interaction layers that this bounded context exposes",
      "type": "array",
      "items": {
        "$ref": "#/$defs/interactionLayerConfiguration"
      }
    },
    "resources": {
      "description": "A map of describing the resource type implementation mapping of resource types",
      "type": "object",
      "properties": {
        "readModels": {
          "$ref": "#/$defs/resourceTypeImplementationConfiguration"
        },
        "eventStore": {
          "$ref": "#/$defs/resourceTypeImplementationConfiguration"
        }
      },
      "required": [
        "readModels",
        "eventStore"
      ]
    }
  },
  "required": [
    "application",
    "boundedContext",
    "boundedContextName",
    "core",
    "interaction",
    "resources"
  ],
  "$defs": {
    "coreConfiguration": {
      "description": "A configuration describing the Core of this bounded context",
      "type": "object",
      "properties": {
        "language": {
          "$comment": "This schema definition allows only a set of core languages by hard coding it here in the enum property. Can probably be done better",
          "description": "Describes which programming language the Core is written in",
          "type": "string",
          "enum": [
            "csharp"
          ]
        },
        "entryPoint": {
          "$comment": "This property is optional. The default value is \"Core\"",
          "description": "The entry point of the bounded context's Core.  A relative path to the folder",
          "type": "string",
          "format": "uri-reference"
        }
      },
      "required": [
        "language"
      ]
    },
    "interactionLayerConfiguration": {
      "description": "The configuration of an interaction layer",
      "type": "object",
      "properties": {
        "type": {
          "$comment": "This schema definition allows only a set of types by hard coding it here in the enum property. Can probably be done better",
          "description": "The type of the interaction layer",
          "type": "string",
          "enum": [
            "web"
          ]
        },
        "language": {
          "description": "The programming language of the interaction layer",
          "type": "string"
        },
        "entryPoint": {
          "description": "The entry point of the interaction layer. A relative path to the folder",
          "type": "string",
          "format": "uri-reference"
        },
        "framework": {
          "$comment": "This schema definition allows only a set of frameworks by hard coding it here in the enum property. Can probably be done better",
          "description": "The framework of the interaction layer",
          "type": "string",
          "enum": [
            "react",
            "aurelia"
          ]
        }
      },
      "required": [
        "type",
        "language",
        "entryPoint"
      ]
    },
    "resourceTypeImplementationConfiguration": {
      "description": "Resource type implementation configuration",
      "type": "object",
      "properties": {
        "production": {
          "type": "string"
        },
        "development": {
          "type": "string"
        }
      },
      "required": [
        "production",
        "development"
      ]
    }
  }
}
