{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/aalto/main/json-schema/aalto-facilities-api-schema.json",
  "title": "Aalto facilities api — component schemas",
  "description": "JSON Schema extracted verbatim from components.schemas of Aalto University's own OpenAPI for Aalto facilities api (version 1.0.2), published on the Aalto API Gateway public ActiveDocs index. Structural conversion only — no schema was authored here.",
  "x-generated": "2026-08-30",
  "x-method": "derived",
  "x-source": "https://raw.githubusercontent.com/api-evangelist/aalto/main/openapi/_original/aalto-facilities-api-openapi.json",
  "x-operator": "institution",
  "$defs": {
    "Reservation": {
      "required": [
        "name",
        "phoneNumber",
        "spaceCode"
      ],
      "type": "object",
      "properties": {
        "id": {
          "type": "integer",
          "format": "int64",
          "example": 123456780
        },
        "name": {
          "type": "string",
          "description": "Event name",
          "example": "TEST Event"
        },
        "buildingCode": {
          "type": "string",
          "example": "R001"
        },
        "spaceCode": {
          "type": "string",
          "description": "Code of the reserved space. Normally room number",
          "example": "U598"
        },
        "date": {
          "type": "string",
          "description": "Reservation date (e.g. 2020-12-25)",
          "format": "date",
          "example": "2020-12-25T00:00:00.000Z"
        },
        "startTime": {
          "type": "string",
          "description": "Reservation start time (e.g. 14:00)",
          "example": 840
        },
        "endTime": {
          "type": "string",
          "description": "Reservation end time (e.g. 14:30)",
          "example": 870
        },
        "duration": {
          "type": "integer",
          "description": "Duration in minutes",
          "format": "int64",
          "example": 30
        },
        "persons": {
          "type": "integer",
          "description": "Number of persons",
          "format": "int64",
          "example": 1
        },
        "type": {
          "type": "string",
          "description": "Usage type. Possible values are Internal (S), Planning (L), Student (A), External (H)",
          "example": "Student"
        },
        "phoneNumber": {
          "type": "string",
          "example": 123456789
        },
        "email": {
          "type": "string",
          "example": "example@email.com"
        }
      },
      "description": "Represents a reservation."
    },
    "errorResponse": {
      "type": "object",
      "properties": {
        "error": {
          "$ref": "#/components/schemas/errorType"
        }
      }
    },
    "errorType": {
      "type": "object",
      "properties": {
        "code": {
          "type": "number"
        },
        "message": {
          "type": "string"
        }
      }
    },
    "buildingsType": {
      "type": "array",
      "items": {
        "$ref": "#/components/schemas/buildingType"
      }
    },
    "buildingType": {
      "type": "object",
      "properties": {
        "buildingCode": {
          "type": "string"
        },
        "nickName": {
          "$ref": "#/components/schemas/nickNameType"
        },
        "address": {
          "$ref": "#/components/schemas/addressType"
        }
      }
    },
    "nickNameType": {
      "type": "object",
      "properties": {
        "fi": {
          "type": "string"
        },
        "sv": {
          "type": "string"
        },
        "en": {
          "type": "string"
        }
      }
    },
    "addressType": {
      "type": "object",
      "properties": {
        "addressLine": {
          "type": "string"
        },
        "postalCode": {
          "type": "string"
        },
        "municipality": {
          "type": "string"
        }
      }
    },
    "buildingDetailsType": {
      "type": "object",
      "properties": {
        "buildingCode": {
          "type": "string"
        },
        "nickName": {
          "$ref": "#/components/schemas/nickNameType"
        },
        "address": {
          "$ref": "#/components/schemas/addressType"
        },
        "openingHours": {
          "$ref": "#/components/schemas/openingHoursType"
        },
        "Rooms": {
          "type": "array",
          "items": {
            "$ref": "#/components/schemas/RoomType"
          }
        }
      }
    },
    "openingHoursType": {
      "type": "object",
      "properties": {
        "ma": {
          "$ref": "#/components/schemas/dailyOpeningHoursType"
        },
        "ti": {
          "$ref": "#/components/schemas/dailyOpeningHoursType"
        },
        "ke": {
          "$ref": "#/components/schemas/dailyOpeningHoursType"
        },
        "to": {
          "$ref": "#/components/schemas/dailyOpeningHoursType"
        },
        "pe": {
          "$ref": "#/components/schemas/dailyOpeningHoursType"
        },
        "la": {
          "$ref": "#/components/schemas/dailyOpeningHoursType"
        },
        "su": {
          "$ref": "#/components/schemas/dailyOpeningHoursType"
        }
      }
    },
    "dailyOpeningHoursType": {
      "type": "object",
      "properties": {
        "aklo": {
          "type": "string"
        },
        "lklo": {
          "type": "string"
        }
      }
    },
    "RoomType": {
      "type": "object",
      "properties": {
        "ID": {
          "type": "string"
        },
        "categories": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "coordinates": {
          "type": "array",
          "items": {
            "type": "number"
          }
        },
        "currentBookingStatus": {
          "type": "string"
        }
      }
    }
  }
}
