{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://redbook.fun/specification/1.0/schemas/resource-import.schema.json",
  "type": "object",
  "properties": {
    "resourceReferences": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "recordId": {
            "type": "string",
            "minLength": 1
          },
          "propertyPath": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "path": {
            "type": "string",
            "minLength": 1,
            "pattern": "^(?!.*(?:^|/)\\.{1,2}(?:/|$))(?!.*\\.(?:/|$))[A-Za-z0-9_.-]+(?:/[A-Za-z0-9_.-]+)*(?![\\s\\S])"
          }
        },
        "required": [
          "recordId",
          "propertyPath",
          "path"
        ],
        "additionalProperties": false
      }
    },
    "typeResources": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "typeId": {
            "type": "string",
            "minLength": 1
          },
          "parts": {
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "pattern": "^(?!.*(?:^|/)\\.{1,2}(?:/|$))(?!.*\\.(?:/|$))[A-Za-z0-9_.-]+(?:/[A-Za-z0-9_.-]+)*(?![\\s\\S])"
            },
            "uniqueItems": true
          }
        },
        "required": [
          "typeId",
          "parts"
        ],
        "additionalProperties": false
      }
    },
    "resourceDependencies": {
      "type": "object",
      "additionalProperties": {
        "type": "array",
        "items": {
          "type": "string",
          "minLength": 1,
          "pattern": "^(?!.*(?:^|/)\\.{1,2}(?:/|$))(?!.*\\.(?:/|$))[A-Za-z0-9_.-]+(?:/[A-Za-z0-9_.-]+)*(?![\\s\\S])"
        },
        "uniqueItems": true
      }
    },
    "resourceKey": {
      "type": "string",
      "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}(?![\\s\\S])"
    },
    "resourceRoot": {
      "type": "string",
      "pattern": "^redbook/imports/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/(?![\\s\\S])"
    },
    "resourceMapping": {
      "type": "object",
      "minProperties": 1,
      "propertyNames": {
        "type": "string",
        "minLength": 1,
        "pattern": "^(?!.*(?:^|/)\\.{1,2}(?:/|$))(?!.*\\.(?:/|$))[A-Za-z0-9_.-]+(?:/[A-Za-z0-9_.-]+)*(?![\\s\\S])"
      },
      "additionalProperties": {
        "type": "string",
        "minLength": 1,
        "pattern": "^(?!.*(?:^|/)\\.{1,2}(?:/|$))(?!.*\\.(?:/|$))[A-Za-z0-9_.-]+(?:/[A-Za-z0-9_.-]+)*(?![\\s\\S])"
      }
    }
  },
  "required": [
    "resourceReferences",
    "typeResources",
    "resourceDependencies",
    "resourceKey",
    "resourceRoot",
    "resourceMapping"
  ],
  "additionalProperties": false
}
