{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://law.arxo.io/schema/import-package-policy.schema.json",
  "type": "object",
  "properties": {
    "format": {
      "const": "arxo.import.package-policy/0.1"
    },
    "packages": {
      "type": "object",
      "additionalProperties": {
        "type": "object",
        "properties": {
          "version": {
            "type": "string"
          },
          "namespace": {
            "type": "string"
          },
          "boundary": {
            "type": "string"
          }
        },
        "required": [
          "version",
          "namespace",
          "boundary"
        ],
        "additionalProperties": false
      },
      "maxProperties": 10000
    },
    "assignments": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "item": {
            "type": "object",
            "properties": {
              "kind": {
                "enum": [
                  "type",
                  "predicate",
                  "reification",
                  "declaration",
                  "fact"
                ]
              },
              "source": {
                "type": "string"
              }
            },
            "required": [
              "kind",
              "source"
            ],
            "additionalProperties": false
          },
          "package": {
            "type": "string"
          }
        },
        "required": [
          "item",
          "package"
        ],
        "additionalProperties": false
      },
      "maxItems": 200000
    }
  },
  "required": [
    "format",
    "packages",
    "assignments"
  ],
  "additionalProperties": false
}
