From 769044b2c5ae3fafc3b3283454b75dd14c9db854 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Commaille?= Date: Sat, 7 Jun 2025 10:01:05 +0200 Subject: [PATCH] Clarify some string formats of room summary endpoint MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Using the custom string formats supported by the spec. Signed-off-by: Kévin Commaille --- .../client-server/definitions/public_rooms_chunk.yaml | 4 ++++ data/api/client-server/definitions/room_summary.yaml | 2 ++ data/api/client-server/room_summary.yaml | 9 ++++++++- 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/data/api/client-server/definitions/public_rooms_chunk.yaml b/data/api/client-server/definitions/public_rooms_chunk.yaml index 89e76059..33276662 100644 --- a/data/api/client-server/definitions/public_rooms_chunk.yaml +++ b/data/api/client-server/definitions/public_rooms_chunk.yaml @@ -17,6 +17,8 @@ title: "PublishedRoomsChunk" properties: canonical_alias: type: string + format: mx-room-alias + pattern: "^#" description: The canonical alias of the room, if any. example: "#general:example.org" name: @@ -29,6 +31,8 @@ properties: example: 42 room_id: type: string + format: mx-room-id + pattern: "^!" description: The ID of the room. example: "!abcdefg:example.org" topic: diff --git a/data/api/client-server/definitions/room_summary.yaml b/data/api/client-server/definitions/room_summary.yaml index a8682e51..8499bac1 100644 --- a/data/api/client-server/definitions/room_summary.yaml +++ b/data/api/client-server/definitions/room_summary.yaml @@ -27,6 +27,8 @@ allOf: type: array items: type: string + format: mx-room-id + pattern: "^!" description: |- If the room is a [restricted room](/server-server-api/#restricted-rooms), these are the room IDs which are specified by the join rules. Empty or omitted otherwise. diff --git a/data/api/client-server/room_summary.yaml b/data/api/client-server/room_summary.yaml index 9d23c829..e5e241ed 100644 --- a/data/api/client-server/room_summary.yaml +++ b/data/api/client-server/room_summary.yaml @@ -46,7 +46,13 @@ paths: required: true example: "#monkeys:matrix.org" schema: - type: string + oneOf: + - type: string + format: mx-room-id + pattern: "^!" + - type: string + format: mx-room-alias + pattern: "^#" - in: query name: via description: |- @@ -60,6 +66,7 @@ paths: type: array items: type: string + format: mx-server-name responses: "200": description: A summary of the room.