{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "open-furniture.house/1",
  "title": "A house for <open-furniture-room>",
  "description": "Millimetres. x runs along the room, z across it, y up from the finished floor. Wall A is z = 0, B is x = length, C is z = width, D is x = 0.",
  "type": "object",
  "required": [
    "clear"
  ],
  "properties": {
    "id": {
      "type": "string",
      "maxLength": 24
    },
    "name": {
      "type": "string",
      "maxLength": 40
    },
    "kind": {
      "type": "string",
      "maxLength": 60,
      "description": "A kind that says container is clad in corrugated steel."
    },
    "clear": {
      "type": "array",
      "minItems": 3,
      "maxItems": 3,
      "items": {
        "type": "number"
      },
      "description": "Length, width and height inside the linings."
    },
    "wall": {
      "type": "number",
      "minimum": 40,
      "maximum": 600
    },
    "openings": {
      "type": "array",
      "maxItems": 24,
      "items": {
        "type": "object",
        "required": [
          "wall",
          "at",
          "w",
          "h"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "wall": {
            "enum": [
              "A",
              "B",
              "C",
              "D"
            ]
          },
          "at": {
            "type": "number",
            "description": "From the wall's start, along x or z."
          },
          "w": {
            "type": "number"
          },
          "sill": {
            "type": "number"
          },
          "h": {
            "type": "number"
          },
          "kind": {
            "enum": [
              "window",
              "door",
              "slider"
            ]
          },
          "entry": {
            "type": "boolean"
          }
        }
      }
    },
    "fixed": {
      "type": "array",
      "maxItems": 24,
      "items": {
        "type": "object",
        "required": [
          "x",
          "z",
          "w",
          "d"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "kind": {
            "enum": [
              "room",
              "kitchen",
              "post",
              "wall"
            ]
          },
          "x": {
            "type": "number"
          },
          "z": {
            "type": "number"
          },
          "w": {
            "type": "number"
          },
          "d": {
            "type": "number"
          },
          "h": {
            "type": "number"
          }
        }
      }
    },
    "rooms": {
      "type": "array",
      "maxItems": 12,
      "items": {
        "type": "object",
        "required": [
          "use",
          "x",
          "z",
          "w",
          "d"
        ],
        "properties": {
          "name": {
            "type": "string"
          },
          "use": {
            "type": "array",
            "items": {
              "enum": [
                "sleep",
                "wear",
                "sit",
                "eat",
                "work",
                "store"
              ]
            }
          },
          "x": {
            "type": "number"
          },
          "z": {
            "type": "number"
          },
          "w": {
            "type": "number"
          },
          "d": {
            "type": "number"
          }
        }
      }
    },
    "lining": {
      "enum": [
        "birch",
        "okoume",
        "chalk",
        "clay",
        "graphite"
      ]
    },
    "floor": {
      "enum": [
        "oak",
        "cork",
        "concrete",
        "terracotta"
      ]
    },
    "north": {
      "type": "number",
      "description": "The bearing wall A faces, in degrees."
    },
    "items": {
      "type": "array",
      "description": "Pieces it opens with. A piece is a catalogue id, a design link, or a family with its length and height such as low/2418/720, bench/2418, tall/1618/2240, shelf/1618/2000, filter/1618/1160, desk/1218, table/1518, seat/1218 or bed/1600.",
      "items": {
        "type": "object",
        "required": [
          "ref",
          "x",
          "z"
        ],
        "properties": {
          "ref": {
            "type": "string"
          },
          "x": {
            "type": "number"
          },
          "z": {
            "type": "number"
          },
          "a": {
            "enum": [
              0,
              90,
              180,
              270
            ]
          }
        }
      }
    }
  }
}
