{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://openeik.org/schemas/0.2/model.schema.json",
  "title": "Single-file model",
  "description": "A whole model as one JSON object: the single-file form of Part III. Lists hold their records in order; views hold their detail items inline; `extras` holds the folder's kept files, text by path. From 0.2 it names its format and units at its top, as eik.json does for a folder (Part III, 11).",
  "type": "object",
  "properties": {
    "format": {
      "$ref": "eik.schema.json#/properties/format"
    },
    "units": {
      "$ref": "eik.schema.json#/properties/units"
    },
    "schemaVersion": {
      "deprecated": true,
      "description": "Deprecated in 0.2, and removed in 1.0: the format names a model's version (Part I, 9.3). A reader of 0.2 does not read it and refuses no value of it; a writer of 0.2 adds none, and keeps one a model gives."
    },
    "project": {
      "$ref": "project/project.schema.json#/properties/project"
    },
    "projectInformation": {
      "$ref": "project/project.schema.json#/properties/projectInformation"
    },
    "levels": {
      "$ref": "project/levels.schema.json"
    },
    "grids": {
      "type": "array",
      "items": {
        "$ref": "project/grid.schema.json"
      }
    },
    "scopeBoxes": {
      "type": "array",
      "items": {
        "$ref": "project/scope-box.schema.json"
      }
    },
    "materials": {
      "type": "array",
      "items": {
        "$ref": "project/material.schema.json"
      }
    },
    "dimensionStyles": {
      "type": "array",
      "items": {
        "$ref": "project/dimension-style.schema.json"
      }
    },
    "detailFamilies": {
      "type": "array",
      "items": {
        "$ref": "project/detail-family.schema.json"
      }
    },
    "titleBlocks": {
      "type": "array",
      "items": {
        "$ref": "application-record.schema.json"
      }
    },
    "images": {
      "type": "array",
      "items": {
        "$ref": "application-record.schema.json"
      }
    },
    "types": {
      "type": "array",
      "items": {
        "allOf": [
          {
            "$ref": "types/type.schema.json"
          },
          {
            "if": {
              "properties": {
                "category": {
                  "const": "slab"
                }
              },
              "required": [
                "category"
              ]
            },
            "then": {
              "$ref": "types/slab.schema.json"
            }
          },
          {
            "if": {
              "properties": {
                "category": {
                  "const": "foundation"
                }
              },
              "required": [
                "category"
              ]
            },
            "then": {
              "$ref": "types/foundation.schema.json"
            }
          },
          {
            "if": {
              "properties": {
                "category": {
                  "const": "wall"
                }
              },
              "required": [
                "category"
              ]
            },
            "then": {
              "$ref": "types/wall.schema.json"
            }
          },
          {
            "if": {
              "properties": {
                "category": {
                  "const": "ceiling"
                }
              },
              "required": [
                "category"
              ]
            },
            "then": {
              "$ref": "types/ceiling.schema.json"
            }
          },
          {
            "if": {
              "properties": {
                "category": {
                  "const": "roof"
                }
              },
              "required": [
                "category"
              ]
            },
            "then": {
              "$ref": "types/roof.schema.json"
            }
          },
          {
            "if": {
              "properties": {
                "category": {
                  "const": "beam"
                }
              },
              "required": [
                "category"
              ]
            },
            "then": {
              "$ref": "types/beam.schema.json"
            }
          },
          {
            "if": {
              "properties": {
                "category": {
                  "const": "column"
                }
              },
              "required": [
                "category"
              ]
            },
            "then": {
              "$ref": "types/column.schema.json"
            }
          },
          {
            "if": {
              "properties": {
                "category": {
                  "const": "door"
                }
              },
              "required": [
                "category"
              ]
            },
            "then": {
              "$ref": "types/door.schema.json"
            }
          },
          {
            "if": {
              "properties": {
                "category": {
                  "const": "window"
                }
              },
              "required": [
                "category"
              ]
            },
            "then": {
              "$ref": "types/window.schema.json"
            }
          },
          {
            "if": {
              "properties": {
                "category": {
                  "const": "slabEdge"
                }
              },
              "required": [
                "category"
              ]
            },
            "then": {
              "$ref": "types/slabEdge.schema.json"
            }
          },
          {
            "if": {
              "properties": {
                "category": {
                  "const": "rebar"
                }
              },
              "required": [
                "category"
              ]
            },
            "then": {
              "$ref": "types/rebar.schema.json"
            }
          },
          {
            "if": {
              "properties": {
                "category": {
                  "const": "mesh"
                }
              },
              "required": [
                "category"
              ]
            },
            "then": {
              "$ref": "types/mesh.schema.json"
            }
          },
          {
            "if": {
              "properties": {
                "category": {
                  "const": "component"
                }
              },
              "required": [
                "category"
              ]
            },
            "then": {
              "$ref": "types/component.schema.json"
            }
          },
          {
            "if": {
              "properties": {
                "category": {
                  "const": "gutter"
                }
              },
              "required": [
                "category"
              ]
            },
            "then": {
              "$ref": "types/gutter.schema.json"
            }
          },
          {
            "if": {
              "properties": {
                "category": {
                  "const": "room"
                }
              },
              "required": [
                "category"
              ]
            },
            "then": {
              "$ref": "types/room.schema.json"
            }
          },
          {
            "if": {
              "properties": {
                "category": {
                  "const": "roomSeparator"
                }
              },
              "required": [
                "category"
              ]
            },
            "then": {
              "$ref": "types/roomSeparator.schema.json"
            }
          },
          {
            "if": {
              "properties": {
                "category": {
                  "const": "shaft"
                }
              },
              "required": [
                "category"
              ]
            },
            "then": {
              "$ref": "types/shaft.schema.json"
            }
          },
          {
            "if": {
              "properties": {
                "category": {
                  "const": "stair"
                }
              },
              "required": [
                "category"
              ]
            },
            "then": {
              "$ref": "types/stair.schema.json"
            }
          },
          {
            "if": {
              "properties": {
                "category": {
                  "const": "railing"
                }
              },
              "required": [
                "category"
              ]
            },
            "then": {
              "$ref": "types/railing.schema.json"
            }
          },
          {
            "if": {
              "properties": {
                "category": {
                  "const": "pipe"
                }
              },
              "required": [
                "category"
              ]
            },
            "then": {
              "$ref": "types/pipe.schema.json"
            }
          },
          {
            "if": {
              "properties": {
                "category": {
                  "const": "duct"
                }
              },
              "required": [
                "category"
              ]
            },
            "then": {
              "$ref": "types/duct.schema.json"
            }
          },
          {
            "if": {
              "properties": {
                "category": {
                  "const": "terminal"
                }
              },
              "required": [
                "category"
              ]
            },
            "then": {
              "$ref": "types/terminal.schema.json"
            }
          },
          {
            "if": {
              "properties": {
                "category": {
                  "const": "terrain"
                }
              },
              "required": [
                "category"
              ]
            },
            "then": {
              "$ref": "types/terrain.schema.json"
            }
          },
          {
            "if": {
              "properties": {
                "category": {
                  "const": "grading"
                }
              },
              "required": [
                "category"
              ]
            },
            "then": {
              "$ref": "types/grading.schema.json"
            }
          },
          {
            "if": {
              "properties": {
                "category": {
                  "const": "propertyLine"
                }
              },
              "required": [
                "category"
              ]
            },
            "then": {
              "$ref": "types/propertyLine.schema.json"
            }
          },
          {
            "if": {
              "properties": {
                "category": {
                  "const": "furniture"
                }
              },
              "required": [
                "category"
              ]
            },
            "then": {
              "$ref": "types/furniture.schema.json"
            }
          },
          {
            "if": {
              "properties": {
                "category": {
                  "const": "planting"
                }
              },
              "required": [
                "category"
              ]
            },
            "then": {
              "$ref": "types/planting.schema.json"
            }
          },
          {
            "if": {
              "properties": {
                "category": {
                  "const": "road"
                }
              },
              "required": [
                "category"
              ]
            },
            "then": {
              "$ref": "types/road.schema.json"
            }
          },
          {
            "if": {
              "properties": {
                "category": {
                  "const": "parking"
                }
              },
              "required": [
                "category"
              ]
            },
            "then": {
              "$ref": "types/parking.schema.json"
            }
          },
          {
            "if": {
              "properties": {
                "category": {
                  "const": "fire"
                }
              },
              "required": [
                "category"
              ]
            },
            "then": {
              "$ref": "types/fire.schema.json"
            }
          },
          {
            "if": {
              "properties": {
                "category": {
                  "const": "generic"
                }
              },
              "required": [
                "category"
              ]
            },
            "then": {
              "$ref": "types/generic.schema.json"
            }
          },
          {
            "if": {
              "properties": {
                "category": {
                  "const": "electrical"
                }
              },
              "required": [
                "category"
              ]
            },
            "then": {
              "$ref": "types/electrical.schema.json"
            }
          },
          {
            "if": {
              "properties": {
                "category": {
                  "const": "cableCarrier"
                }
              },
              "required": [
                "category"
              ]
            },
            "then": {
              "$ref": "types/cableCarrier.schema.json"
            }
          },
          {
            "if": {
              "properties": {
                "category": {
                  "const": "cable"
                }
              },
              "required": [
                "category"
              ]
            },
            "then": {
              "$ref": "types/cable.schema.json"
            }
          },
          {
            "if": {
              "properties": {
                "category": {
                  "const": "member"
                }
              },
              "required": [
                "category"
              ]
            },
            "then": {
              "$ref": "types/member.schema.json"
            }
          },
          {
            "if": {
              "properties": {
                "category": {
                  "const": "provision"
                }
              },
              "required": [
                "category"
              ]
            },
            "then": {
              "$ref": "types/provision.schema.json"
            }
          }
        ]
      }
    },
    "elements": {
      "type": "array",
      "items": {
        "allOf": [
          {
            "$ref": "elements/element.schema.json"
          },
          {
            "if": {
              "properties": {
                "category": {
                  "const": "slab"
                }
              },
              "required": [
                "category"
              ]
            },
            "then": {
              "$ref": "elements/slab.schema.json"
            }
          },
          {
            "if": {
              "properties": {
                "category": {
                  "const": "foundation"
                }
              },
              "required": [
                "category"
              ]
            },
            "then": {
              "$ref": "elements/foundation.schema.json"
            }
          },
          {
            "if": {
              "properties": {
                "category": {
                  "const": "wall"
                }
              },
              "required": [
                "category"
              ]
            },
            "then": {
              "$ref": "elements/wall.schema.json"
            }
          },
          {
            "if": {
              "properties": {
                "category": {
                  "const": "ceiling"
                }
              },
              "required": [
                "category"
              ]
            },
            "then": {
              "$ref": "elements/ceiling.schema.json"
            }
          },
          {
            "if": {
              "properties": {
                "category": {
                  "const": "roof"
                }
              },
              "required": [
                "category"
              ]
            },
            "then": {
              "$ref": "elements/roof.schema.json"
            }
          },
          {
            "if": {
              "properties": {
                "category": {
                  "const": "beam"
                }
              },
              "required": [
                "category"
              ]
            },
            "then": {
              "$ref": "elements/beam.schema.json"
            }
          },
          {
            "if": {
              "properties": {
                "category": {
                  "const": "column"
                }
              },
              "required": [
                "category"
              ]
            },
            "then": {
              "$ref": "elements/column.schema.json"
            }
          },
          {
            "if": {
              "properties": {
                "category": {
                  "const": "door"
                }
              },
              "required": [
                "category"
              ]
            },
            "then": {
              "$ref": "elements/door.schema.json"
            }
          },
          {
            "if": {
              "properties": {
                "category": {
                  "const": "window"
                }
              },
              "required": [
                "category"
              ]
            },
            "then": {
              "$ref": "elements/window.schema.json"
            }
          },
          {
            "if": {
              "properties": {
                "category": {
                  "const": "slabEdge"
                }
              },
              "required": [
                "category"
              ]
            },
            "then": {
              "$ref": "elements/slabEdge.schema.json"
            }
          },
          {
            "if": {
              "properties": {
                "category": {
                  "const": "rebar"
                }
              },
              "required": [
                "category"
              ]
            },
            "then": {
              "$ref": "elements/rebar.schema.json"
            }
          },
          {
            "if": {
              "properties": {
                "category": {
                  "const": "mesh"
                }
              },
              "required": [
                "category"
              ]
            },
            "then": {
              "$ref": "elements/mesh.schema.json"
            }
          },
          {
            "if": {
              "properties": {
                "category": {
                  "const": "component"
                }
              },
              "required": [
                "category"
              ]
            },
            "then": {
              "$ref": "elements/component.schema.json"
            }
          },
          {
            "if": {
              "properties": {
                "category": {
                  "const": "gutter"
                }
              },
              "required": [
                "category"
              ]
            },
            "then": {
              "$ref": "elements/gutter.schema.json"
            }
          },
          {
            "if": {
              "properties": {
                "category": {
                  "const": "room"
                }
              },
              "required": [
                "category"
              ]
            },
            "then": {
              "$ref": "elements/room.schema.json"
            }
          },
          {
            "if": {
              "properties": {
                "category": {
                  "const": "roomSeparator"
                }
              },
              "required": [
                "category"
              ]
            },
            "then": {
              "$ref": "elements/roomSeparator.schema.json"
            }
          },
          {
            "if": {
              "properties": {
                "category": {
                  "const": "shaft"
                }
              },
              "required": [
                "category"
              ]
            },
            "then": {
              "$ref": "elements/shaft.schema.json"
            }
          },
          {
            "if": {
              "properties": {
                "category": {
                  "const": "stair"
                }
              },
              "required": [
                "category"
              ]
            },
            "then": {
              "$ref": "elements/stair.schema.json"
            }
          },
          {
            "if": {
              "properties": {
                "category": {
                  "const": "railing"
                }
              },
              "required": [
                "category"
              ]
            },
            "then": {
              "$ref": "elements/railing.schema.json"
            }
          },
          {
            "if": {
              "properties": {
                "category": {
                  "const": "pipe"
                }
              },
              "required": [
                "category"
              ]
            },
            "then": {
              "$ref": "elements/pipe.schema.json"
            }
          },
          {
            "if": {
              "properties": {
                "category": {
                  "const": "duct"
                }
              },
              "required": [
                "category"
              ]
            },
            "then": {
              "$ref": "elements/duct.schema.json"
            }
          },
          {
            "if": {
              "properties": {
                "category": {
                  "const": "terminal"
                }
              },
              "required": [
                "category"
              ]
            },
            "then": {
              "$ref": "elements/terminal.schema.json"
            }
          },
          {
            "if": {
              "properties": {
                "category": {
                  "const": "terrain"
                }
              },
              "required": [
                "category"
              ]
            },
            "then": {
              "$ref": "elements/terrain.schema.json"
            }
          },
          {
            "if": {
              "properties": {
                "category": {
                  "const": "grading"
                }
              },
              "required": [
                "category"
              ]
            },
            "then": {
              "$ref": "elements/grading.schema.json"
            }
          },
          {
            "if": {
              "properties": {
                "category": {
                  "const": "propertyLine"
                }
              },
              "required": [
                "category"
              ]
            },
            "then": {
              "$ref": "elements/propertyLine.schema.json"
            }
          },
          {
            "if": {
              "properties": {
                "category": {
                  "const": "furniture"
                }
              },
              "required": [
                "category"
              ]
            },
            "then": {
              "$ref": "elements/furniture.schema.json"
            }
          },
          {
            "if": {
              "properties": {
                "category": {
                  "const": "planting"
                }
              },
              "required": [
                "category"
              ]
            },
            "then": {
              "$ref": "elements/planting.schema.json"
            }
          },
          {
            "if": {
              "properties": {
                "category": {
                  "const": "road"
                }
              },
              "required": [
                "category"
              ]
            },
            "then": {
              "$ref": "elements/road.schema.json"
            }
          },
          {
            "if": {
              "properties": {
                "category": {
                  "const": "parking"
                }
              },
              "required": [
                "category"
              ]
            },
            "then": {
              "$ref": "elements/parking.schema.json"
            }
          },
          {
            "if": {
              "properties": {
                "category": {
                  "const": "fire"
                }
              },
              "required": [
                "category"
              ]
            },
            "then": {
              "$ref": "elements/fire.schema.json"
            }
          },
          {
            "if": {
              "properties": {
                "category": {
                  "const": "generic"
                }
              },
              "required": [
                "category"
              ]
            },
            "then": {
              "$ref": "elements/generic.schema.json"
            }
          },
          {
            "if": {
              "properties": {
                "category": {
                  "const": "electrical"
                }
              },
              "required": [
                "category"
              ]
            },
            "then": {
              "$ref": "elements/electrical.schema.json"
            }
          },
          {
            "if": {
              "properties": {
                "category": {
                  "const": "cableCarrier"
                }
              },
              "required": [
                "category"
              ]
            },
            "then": {
              "$ref": "elements/cableCarrier.schema.json"
            }
          },
          {
            "if": {
              "properties": {
                "category": {
                  "const": "cable"
                }
              },
              "required": [
                "category"
              ]
            },
            "then": {
              "$ref": "elements/cable.schema.json"
            }
          },
          {
            "if": {
              "properties": {
                "category": {
                  "const": "member"
                }
              },
              "required": [
                "category"
              ]
            },
            "then": {
              "$ref": "elements/member.schema.json"
            }
          },
          {
            "if": {
              "properties": {
                "category": {
                  "const": "provision"
                }
              },
              "required": [
                "category"
              ]
            },
            "then": {
              "$ref": "elements/provision.schema.json"
            }
          }
        ]
      }
    },
    "views": {
      "type": "array",
      "items": {
        "$ref": "drawings/view.schema.json"
      }
    },
    "sheets": {
      "type": "array",
      "items": {
        "$ref": "drawings/sheet-record.schema.json"
      }
    },
    "reports": {
      "type": "array",
      "items": {
        "$ref": "application-record.schema.json"
      }
    },
    "renders": {
      "type": "array",
      "items": {
        "$ref": "application-record.schema.json"
      }
    },
    "deviations": {
      "type": "array",
      "items": {
        "$ref": "application-record.schema.json"
      }
    },
    "areaAdjustments": {
      "type": "array",
      "items": {
        "$ref": "application-record.schema.json"
      }
    },
    "references": {
      "type": "array",
      "items": {
        "$ref": "application-record.schema.json"
      }
    },
    "pieces": {
      "type": "array",
      "items": {
        "$ref": "fabrication/piece.schema.json"
      }
    },
    "joints": {
      "type": "array",
      "items": {
        "$ref": "fabrication/joint.schema.json"
      }
    },
    "originals": {
      "type": "array",
      "items": {
        "$ref": "project/original.schema.json"
      }
    },
    "copies": {
      "type": "array",
      "items": {
        "$ref": "project/copy.schema.json"
      }
    },
    "extras": {
      "type": "object",
      "additionalProperties": {
        "type": "string"
      }
    },
    "circuits": {
      "type": "array",
      "items": {
        "$ref": "project/circuit.schema.json"
      }
    },
    "people": {
      "type": "array",
      "items": {
        "$ref": "project/person.schema.json"
      }
    }
  },
  "required": [
    "format",
    "units",
    "project",
    "levels",
    "types",
    "elements",
    "views"
  ],
  "x-eik-closed": true
}
