Skip to content

Commit

Permalink
explicitely specified the types for RoomEntry.type and `SitesBuildi…
Browse files Browse the repository at this point in the history
…ngsEntry.type`
  • Loading branch information
CommanderStorm committed Apr 10, 2024
1 parent e708a62 commit fa5e8c8
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 16 deletions.
52 changes: 39 additions & 13 deletions openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1714,27 +1714,53 @@ components:
- facet
- entries
RoomEntry:
allOf:
- $ref: '#/components/schemas/SitesBuildingsEntry'
- type: object
required:
- subtext_bold
properties:
subtext_bold:
description: 'Subtext to show below the search (by default in bold and after the non-bold subtext). Usually contains the arch-id of the room, which is another common room id format, and supports highlighting.'
type: string
parsed_id:
description: 'This is an optional feature, that is only supported for some rooms. It might be displayed instead or before the name, to show that a different room id format has matched, that was probably used. See the image below for an example. It will be cropped to a maximum length to not take too much space in UIs. Supports highlighting.'
type: string
type: object
properties:
id:
description: The id of the room
type: string
type:
description: the type of the room
type: string
example: room
enum:
- room
- virtual_room
- poi # unclear if this should be here
name:
description: Subtext to show below the search result. Usually contains the context of where this rooms is located in. Currently not highlighted.
type: string
subtext:
description: Subtext to show below the search result. Usually contains the context of where this rooms is located in. Currently not highlighted.
type: string
subtext_bold:
description: 'Subtext to show below the search (by default in bold and after the non-bold subtext). Usually contains the arch-id of the room, which is another common room id format, and supports highlighting.'
type: string
parsed_id:
description: 'This is an optional feature, that is only supported for some rooms. It might be displayed instead or before the name, to show that a different room id format has matched, that was probably used. See the image below for an example. It will be cropped to a maximum length to not take too much space in UIs. Supports highlighting.'
type: string
required:
- id
- type
- name
- subtext
- subtext_bold
SitesBuildingsEntry:
type: object
properties:
id:
description: The id of the room
type: string
type:
description: the type of the room/site/building
description: the type of the site/building
type: string
example: campus
enum:
- campus
- building
- area
- site
- joined_building
name:
description: Subtext to show below the search result. Usually contains the context of where this rooms is located in. Currently not highlighted.
type: string
Expand Down
22 changes: 19 additions & 3 deletions webclient/api_types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,19 @@ export type components = {
*/
readonly n_visible: number;
};
readonly RoomEntry: components["schemas"]["SitesBuildingsEntry"] & {
readonly RoomEntry: {
/** @description The id of the room */
readonly id: string;
/**
* @description the type of the room
* @example room
* @enum {string}
*/
readonly type: "room" | "virtual_room" | "poi";
/** @description Subtext to show below the search result. Usually contains the context of where this rooms is located in. Currently not highlighted. */
readonly name: string;
/** @description Subtext to show below the search result. Usually contains the context of where this rooms is located in. Currently not highlighted. */
readonly subtext: string;
/** @description Subtext to show below the search (by default in bold and after the non-bold subtext). Usually contains the arch-id of the room, which is another common room id format, and supports highlighting. */
readonly subtext_bold: string;
/** @description This is an optional feature, that is only supported for some rooms. It might be displayed instead or before the name, to show that a different room id format has matched, that was probably used. See the image below for an example. It will be cropped to a maximum length to not take too much space in UIs. Supports highlighting. */
Expand All @@ -451,8 +463,12 @@ export type components = {
readonly SitesBuildingsEntry: {
/** @description The id of the room */
readonly id: string;
/** @description the type of the room/site/building */
readonly type: string;
/**
* @description the type of the site/building
* @example campus
* @enum {string}
*/
readonly type: "campus" | "building" | "area" | "site" | "joined_building";
/** @description Subtext to show below the search result. Usually contains the context of where this rooms is located in. Currently not highlighted. */
readonly name: string;
/** @description Subtext to show below the search result. Usually contains the context of where this rooms is located in. Currently not highlighted. */
Expand Down

0 comments on commit fa5e8c8

Please sign in to comment.