{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "contract": {
      "type": "string",
      "const": "ProjectionSpec"
    },
    "projectionId": {
      "type": "string",
      "minLength": 1,
      "maxLength": 256
    },
    "ontologyIds": {
      "minItems": 1,
      "type": "array",
      "items": {
        "type": "string",
        "minLength": 1,
        "maxLength": 256
      }
    },
    "outputSchemaRef": {
      "type": "string",
      "minLength": 1,
      "maxLength": 256
    },
    "operator": {
      "type": "object",
      "properties": {
        "kind": {
          "type": "string",
          "enum": [
            "query",
            "aggregate",
            "relationship",
            "search",
            "custom"
          ]
        },
        "configuration": {
          "default": {},
          "type": "object",
          "propertyNames": {
            "type": "string"
          },
          "additionalProperties": {
            "$ref": "#/$defs/__schema0"
          }
        }
      },
      "required": [
        "kind",
        "configuration"
      ],
      "additionalProperties": false
    },
    "materialization": {
      "type": "string",
      "enum": [
        "on-demand",
        "event-driven",
        "scheduled"
      ]
    },
    "invalidationEvents": {
      "default": [],
      "type": "array",
      "items": {
        "type": "string",
        "minLength": 1,
        "maxLength": 256
      }
    },
    "rebuildable": {
      "type": "boolean",
      "const": true
    },
    "lineagePolicy": {
      "type": "object",
      "properties": {
        "sourceRecords": {
          "type": "boolean"
        },
        "bodyVersions": {
          "type": "boolean"
        },
        "runRefs": {
          "type": "boolean"
        },
        "actorRefs": {
          "type": "boolean"
        }
      },
      "required": [
        "sourceRecords",
        "bodyVersions",
        "runRefs",
        "actorRefs"
      ],
      "additionalProperties": false
    }
  },
  "required": [
    "contract",
    "projectionId",
    "ontologyIds",
    "outputSchemaRef",
    "operator",
    "materialization",
    "invalidationEvents",
    "rebuildable",
    "lineagePolicy"
  ],
  "additionalProperties": false,
  "$defs": {
    "__schema0": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "number"
        },
        {
          "type": "boolean"
        },
        {
          "type": "null"
        },
        {
          "type": "array",
          "items": {
            "$ref": "#/$defs/__schema0"
          }
        },
        {
          "type": "object",
          "propertyNames": {
            "type": "string"
          },
          "additionalProperties": {
            "$ref": "#/$defs/__schema0"
          }
        }
      ]
    }
  },
  "$id": "https://schemas.infmonkeys.com/contracts/projection-spec.schema.json",
  "title": "projection-spec"
}
