{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/open-education-api/main/json-schema/open-education-api-room-schema.json",
  "title": "Room",
  "description": "An area within a building where education can take place",
  "x-generated": "2026-10-09",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/open-education-api-v5-openapi.yml#/components/schemas/Room",
  "type": "object",
  "required": [
    "roomId",
    "roomType",
    "name",
    "primaryCode"
  ],
  "properties": {
    "roomId": {
      "type": "string",
      "description": "Unique id for this room",
      "format": "uuid"
    },
    "primaryCode": {
      "description": "The primary human readable identifier for the room. This is often the source identifier as defined by the institution.",
      "$ref": "#/$defs/IdentifierEntry"
    },
    "roomType": {
      "$ref": "#/$defs/roomType"
    },
    "abbreviation": {
      "type": "string",
      "description": "The abbreviation of the name of this room",
      "maxLength": 256
    },
    "name": {
      "type": "array",
      "description": "The name of this room",
      "minItems": 1,
      "items": {
        "$ref": "#/$defs/LanguageTypedString"
      }
    },
    "description": {
      "type": "array",
      "description": "The description of this room. [The limited implementation of Git Hub Markdown syntax](#tag/formatting-and-displaying-results-from-API) MAY be used for rich text representation.",
      "minItems": 1,
      "items": {
        "$ref": "#/$defs/LanguageTypedString"
      }
    },
    "totalSeats": {
      "type": "integer",
      "format": "int32",
      "description": "The total number of seats located in the room"
    },
    "availableSeats": {
      "type": "integer",
      "format": "int32",
      "description": "The total number of available (=non-reserved) seats in the room"
    },
    "floor": {
      "type": "string",
      "description": "The floor on which this room is located"
    },
    "wing": {
      "type": "string",
      "description": "The wing in which this room is located"
    },
    "geolocation": {
      "type": "object",
      "description": "Geolocation of the entrance of this room (WGS84 coordinate reference system)",
      "required": [
        "latitude",
        "longitude"
      ],
      "properties": {
        "latitude": {
          "type": "number",
          "format": "double"
        },
        "longitude": {
          "type": "number",
          "format": "double"
        }
      }
    },
    "otherCodes": {
      "type": "array",
      "description": "An array of additional human readable codes/identifiers for the entity being described.",
      "items": {
        "$ref": "#/$defs/IdentifierEntry"
      }
    },
    "building": {
      "description": "The building in which the room is located. [`expandable`](#tag/building_model)\nBy default only the `buildingId` (a string) is returned. If the client requested an expansion of `building` the full building object should be returned.\n",
      "oneOf": [
        {
          "$ref": "#/$defs/Identifier",
          "title": "buildingId"
        },
        {
          "$ref": "#/$defs/Building",
          "title": "Building object"
        }
      ]
    },
    "consumers": {
      "description": "The additional consumer elements that can be provided, see the [documentation on support for specific consumers](https://openonderwijsapi.nl/v5/#/technical/consumers-and-profiles/) for more information about this mechanism.",
      "type": "array",
      "items": {
        "$ref": "#/$defs/Consumer"
      }
    },
    "ext": {
      "$ref": "#/$defs/Ext"
    }
  },
  "$defs": {
    "Address": {
      "type": "object",
      "description": "The full street address",
      "required": [
        "addressType"
      ],
      "properties": {
        "addressType": {
          "$ref": "#/$defs/addressType"
        },
        "street": {
          "type": "string",
          "description": "The street name"
        },
        "streetNumber": {
          "type": "string",
          "description": "The street number"
        },
        "additional": {
          "type": "array",
          "description": "Further details like building name, suite, apartment number, etc.",
          "minItems": 1,
          "items": {
            "$ref": "#/$defs/LanguageTypedString"
          }
        },
        "postalCode": {
          "type": "string",
          "description": "Postal code"
        },
        "city": {
          "type": "string",
          "description": "name of the city / locality"
        },
        "countryCode": {
          "type": "string",
          "description": "the country code according to [iso-3166-1-alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)"
        },
        "geolocation": {
          "type": "object",
          "description": "Geolocation of the entrance of this address (WGS84 coordinate reference system)",
          "required": [
            "latitude",
            "longitude"
          ],
          "properties": {
            "latitude": {
              "type": "number",
              "format": "double"
            },
            "longitude": {
              "type": "number",
              "format": "double"
            }
          }
        },
        "ext": {
          "$ref": "#/$defs/Ext"
        }
      }
    },
    "Building": {
      "type": "object",
      "description": "An object describing a building and the properties of a building.",
      "required": [
        "buildingId",
        "name",
        "address",
        "primaryCode"
      ],
      "properties": {
        "buildingId": {
          "type": "string",
          "description": "Unique id of this building",
          "format": "uuid"
        },
        "primaryCode": {
          "description": "The primary human readable identifier for this building. This is often the source identifier as defined by the institution.",
          "$ref": "#/$defs/IdentifierEntry"
        },
        "abbreviation": {
          "type": "string",
          "description": "The abbreviation of the name of this building",
          "maxLength": 256
        },
        "name": {
          "type": "array",
          "description": "The name of this building",
          "minItems": 1,
          "items": {
            "$ref": "#/$defs/LanguageTypedString"
          }
        },
        "description": {
          "type": "array",
          "description": "The description of this building.",
          "minItems": 1,
          "items": {
            "$ref": "#/$defs/LanguageTypedString"
          }
        },
        "address": {
          "$ref": "#/$defs/Address"
        },
        "otherCodes": {
          "type": "array",
          "description": "An array of additional human readable codes/identifiers for the entity being described.",
          "items": {
            "$ref": "#/$defs/IdentifierEntry"
          }
        },
        "consumers": {
          "description": "The additional consumer elements that can be provided, see the [documentation on support for specific consumers](https://openonderwijsapi.nl/v5/#/technical/consumers-and-profiles/) for more information about this mechanism.",
          "type": "array",
          "items": {
            "$ref": "#/$defs/Consumer"
          }
        },
        "ext": {
          "$ref": "#/$defs/Ext"
        }
      }
    },
    "Consumer": {
      "type": "object",
      "description": "Object for communicating data to a specific consumer (destination). This object has no relationship with the `consumer` query parameter.",
      "required": [
        "consumerKey"
      ],
      "properties": {
        "consumerKey": {
          "description": "The key of the consumer (destination) for which this information is intended. See the [consumer registry](https://openonderwijsapi.nl/v5/#/technical/consumers-and-profiles/) for more information.",
          "type": "string"
        }
      },
      "additionalProperties": true
    },
    "Ext": {
      "type": "object",
      "description": "Object for additional non-standard attributes"
    },
    "Identifier": {
      "type": "string",
      "description": "An identifier of another resource.",
      "format": "uuid"
    },
    "IdentifierEntry": {
      "type": "object",
      "properties": {
        "codeType": {
          "$ref": "#/$defs/codeType"
        },
        "code": {
          "description": "Human readable value for the code/identifier",
          "type": "string"
        }
      },
      "required": [
        "codeType",
        "code"
      ],
      "additionalProperties": false
    },
    "LanguageTypedString": {
      "type": "object",
      "description": "A String with an associated language code.",
      "properties": {
        "language": {
          "description": "The language used in the described entity. A string formatted according to RFC3066.",
          "type": "string",
          "pattern": "^[a-z]{2,4}(-[A-Z][a-z]{3})?(-([A-Z]{2}|[0-9]{3}))?$"
        },
        "value": {
          "description": "String to describe the entity.",
          "type": "string"
        }
      }
    },
    "addressType": {
      "type": "string",
      "description": "Address type\n- postal: post\n- visit: bezoek\n- deliveries: bezorg\n- billing: factuur\n- teaching: the address where education takes place\n",
      "enum": [
        "postal",
        "visit",
        "deliveries",
        "billing",
        "teaching"
      ]
    },
    "codeType": {
      "type": "string",
      "description": "The code/identifier type. \n\nThis is an *extensible enumeration*. Use `x-` to prefix custom values\n\nThe predefined values are:\n  - `brin`: The registration number for a Dutch educational institution that is issued by the Dutch Ministry of Education, Culture and Science\n  - `crohoCreboCode`: programs with a CREBO and CROHO number are accredited by the Dutch Ministry of Education, Culture and Science (OCW)\n  - `programCode`: Identifier for the program (collection of courses)\n  - `componentCode`: The code for a component (part of a course)\n  - `offeringCode`: The code to identify a specific offering (program, course or component offering)\n  - `organizationId`: The identifier for the organization\n  - `buildingId`: The number or code to identify a building\n  - `bagId`: The identification of a building as it is known in the Dutch Building Administration (BAG)\n  - `roomCode`: The code for a room\n  - `systemId`: Identifier assigned to an entity in context of a specific system\n  - `productId`: Identifier assigned to a specific product\n  - `nationalIdentityNumber`: Identifier assigned by the governement of the person. e.g. a social security number in the USA\n  - `studentNumber`: Identifier for the student\n  - `studielinkNumber`: Identifier for the person as determined by Studielink\n  - `esi`: European Student Identifier\n  - `userName`: The name of a user\n  - `accountId`: Identifier assigned to a specific account\n  - `emailAdress`: An email address\n  - `groupCode`: The identifier for a group (of persons)\n  - `isbn`: International Standard Book Number that serve as product identifiers for Books\n  - `issn`: International Standard Book Number that serve as product identifiers for periodicals\n  - `orcId`: Open Researcher and Contributor ID\n  - `uuid`: A universally unique identifier\n  - `schacHome`: Home organization using the domain name of the organization\n  - `identifier`: Generic Identifier\n",
      "x-ooapi-extensible-enum": [
        "brin",
        "crohoCreboCode",
        "programCode",
        "componentCode",
        "offeringCode",
        "organizationId",
        "buildingId",
        "bagId",
        "roomCode",
        "systemId",
        "productId",
        "nationalIdentityNumber",
        "studentNumber",
        "studielinkNumber",
        "esi",
        "userName",
        "accountId",
        "emailAdress",
        "groupCode",
        "isbn",
        "issn",
        "orcId",
        "uuid",
        "schacHome",
        "identifier"
      ]
    },
    "roomType": {
      "type": "string",
      "description": "The type of this room\n- general purpose: algemeen\n- lecture room: collegezaal\n- computer room: computerruimte\n- laboratory: laboratorium\n- office: kantoor\n- workspace: werkruimte\n- exam location: tentamenruimte\n- study room: studieruimte\n- examination room: onderzoekskamer\n- conference room: vergaderkamer\n",
      "enum": [
        "general purpose",
        "lecture room",
        "computer room",
        "laboratory",
        "office",
        "workspace",
        "exam location",
        "study room",
        "examination room",
        "conference room"
      ]
    }
  }
}