{
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "$id": "https://usebldg.com/schemas/ComponentObservation.schema.json",
 "$defs": {
  "ComponentParam": {
   "additionalProperties": false,
   "description": "One catalog family parameter other than the size, e.g. {\"name\": \"seats\", \"value\": 6}: a length (document\nunits), a count, a switch (true / false) or an option (\"round\"), as the family defines it.",
   "properties": {
    "name": {
     "description": "Family parameter name (a parameter of the component's catalog family).",
     "pattern": "^[A-Za-z][A-Za-z0-9_]{0,23}$",
     "title": "Name",
     "type": "string"
    },
    "value": {
     "anyOf": [
      {
       "type": "boolean"
      },
      {
       "type": "number"
      },
      {
       "type": "string"
      }
     ],
     "description": "Length, count, true / false, or an option string.",
     "title": "Value"
    }
   },
   "required": [
    "name",
    "value"
   ],
   "title": "ComponentParam",
   "type": "object"
  }
 },
 "additionalProperties": false,
 "description": "A furniture, sanitary or equipment item as drawn: its catalog family, body size and placement (items of\nequal family, size and parameters share one component type in the stored plan).",
 "properties": {
  "id": {
   "description": "Identifier of this element, unique across the whole plan.",
   "pattern": "^[A-Za-z_][A-Za-z0-9_.\\-]{0,63}$",
   "title": "Id",
   "type": "string"
  },
  "model": {
   "description": "Catalog family id (bldg_catalog: bed, wardrobe, dining_table, toilet ...) or generic.",
   "maxLength": 97,
   "pattern": "^([a-z][a-z0-9_]{0,31}:)?[a-z0-9][a-z0-9_.\\-]{0,63}$",
   "title": "Model",
   "type": "string"
  },
  "x": {
   "description": "Centre x.",
   "title": "X",
   "type": "number"
  },
  "y": {
   "description": "Centre y.",
   "title": "Y",
   "type": "number"
  },
  "width": {
   "description": "Body size along its local x axis; 0 = the family's default size.",
   "minimum": 0,
   "title": "Width",
   "type": "number"
  },
  "depth": {
   "description": "Body size along its local y axis; 0 = the family's default size.",
   "minimum": 0,
   "title": "Depth",
   "type": "number"
  },
  "dir": {
   "default": [
    1,
    0
   ],
   "description": "The image of its local +x axis [dx, dy] (integers in lowest terms, |dx| and |dy| at most 1000), dy up the drawing as it is seen (in an image frame too: against the pixel y): at [1, 0] the front faces visually down, a stair climbs along local +x.",
   "items": {
    "maximum": 1000,
    "minimum": -1000,
    "type": "integer"
   },
   "maxItems": 2,
   "minItems": 2,
   "title": "Dir",
   "type": "array"
  },
  "params": {
   "description": "Family parameters other than the size (e.g. seats, shape round); [] = the defaults.",
   "items": {
    "$ref": "#/$defs/ComponentParam"
   },
   "maxItems": 16,
   "title": "Params",
   "type": "array"
  },
  "height": {
   "default": 0.0,
   "description": "Body height; 0 = the family default.",
   "minimum": 0,
   "title": "Height",
   "type": "number",
   "x-bldg-scope": "detail"
  }
 },
 "required": [
  "id",
  "model",
  "x",
  "y",
  "width",
  "depth"
 ],
 "title": "ComponentObservation",
 "type": "object"
}
