From 1449321ea110a0f8d818b787038bceaded49d10a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Commaille?= <76261501+zecakeh@users.noreply.github.com> Date: Tue, 12 May 2026 17:38:35 +0200 Subject: [PATCH] Improve "Typing Notifications" section of the CS API (#2375) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Convert m.typing JSON schema to YAML For consistency with other schemas. Signed-off-by: Kévin Commaille * Clarify string formats in Typing Notifications section of the CS API Signed-off-by: Kévin Commaille * Add changelog Signed-off-by: Kévin Commaille --------- Signed-off-by: Kévin Commaille --- .../newsfragments/2375.clarification | 1 + data/api/client-server/typing.yaml | 4 ++ data/event-schemas/schema/m.typing.yaml | 56 +++++++++---------- 3 files changed, 32 insertions(+), 29 deletions(-) create mode 100644 changelogs/client_server/newsfragments/2375.clarification diff --git a/changelogs/client_server/newsfragments/2375.clarification b/changelogs/client_server/newsfragments/2375.clarification new file mode 100644 index 00000000..bdcce777 --- /dev/null +++ b/changelogs/client_server/newsfragments/2375.clarification @@ -0,0 +1 @@ +Clarify formats of string types. diff --git a/data/api/client-server/typing.yaml b/data/api/client-server/typing.yaml index 0d21f452..9b0d1653 100644 --- a/data/api/client-server/typing.yaml +++ b/data/api/client-server/typing.yaml @@ -36,6 +36,8 @@ paths: example: "@alice:example.com" schema: type: string + format: mx-user-id + pattern: "^@" - in: path name: roomId description: The room in which the user is typing. @@ -43,6 +45,8 @@ paths: example: "!wefh3sfukhs:example.com" schema: type: string + format: mx-room-id + pattern: "^!" requestBody: content: application/json: diff --git a/data/event-schemas/schema/m.typing.yaml b/data/event-schemas/schema/m.typing.yaml index 58aeab4e..d2858642 100644 --- a/data/event-schemas/schema/m.typing.yaml +++ b/data/event-schemas/schema/m.typing.yaml @@ -1,29 +1,27 @@ -{ - "$schema": "https://json-schema.org/draft/2020-12/schema", - "type": "object", - "title": "Typing Event", - "description": "Informs the client of the list of users currently typing.", - "allOf": [{ - "$ref": "core-event-schema/event.yaml" - }], - "properties": { - "content": { - "type": "object", - "properties": { - "user_ids": { - "type": "array", - "items": { - "type": "string" - }, - "description": "The list of user IDs typing in this room, if any." - } - }, - "required": ["user_ids"] - }, - "type": { - "type": "string", - "enum": ["m.typing"] - } - }, - "required": ["type", "content"] -} +$schema: https://json-schema.org/draft/2020-12/schema + +type: object +title: Typing Event +description: Informs the client of the list of users currently typing. +allOf: +- $ref: core-event-schema/event.yaml +properties: + content: + type: object + properties: + user_ids: + type: array + items: + type: string + format: mx-user-id + pattern: "^@" + description: The list of user IDs typing in this room, if any. + required: + - user_ids + type: + type: string + enum: + - m.typing +required: +- type +- content