From d0d71d99973497d01faf7bc4abb425f1c09f1a03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Commaille?= <76261501+zecakeh@users.noreply.github.com> Date: Fri, 17 Jan 2025 18:18:51 +0100 Subject: [PATCH] Clarify formats of string types in account sections (#2046) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Kévin Commaille --- changelogs/client_server/newsfragments/2046.clarification | 1 + data/api/client-server/registration.yaml | 3 +++ data/api/client-server/whoami.yaml | 2 ++ data/api/identity/definitions/request_email_validation.yaml | 2 ++ data/api/identity/definitions/request_msisdn_validation.yaml | 1 + data/event-schemas/schema/m.identity_server.yaml | 5 ++++- 6 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 changelogs/client_server/newsfragments/2046.clarification diff --git a/changelogs/client_server/newsfragments/2046.clarification b/changelogs/client_server/newsfragments/2046.clarification new file mode 100644 index 000000000..bdcce7771 --- /dev/null +++ b/changelogs/client_server/newsfragments/2046.clarification @@ -0,0 +1 @@ +Clarify formats of string types. diff --git a/data/api/client-server/registration.yaml b/data/api/client-server/registration.yaml index 1dd314b8b..a418d2d2f 100644 --- a/data/api/client-server/registration.yaml +++ b/data/api/client-server/registration.yaml @@ -135,6 +135,8 @@ paths: properties: user_id: type: string + format: mx-user-id + pattern: "^@" description: |- The fully-qualified Matrix user ID (MXID) that has been registered. @@ -169,6 +171,7 @@ paths: x-addedInMatrixVersion: "1.3" home_server: type: string + format: mx-server-name deprecated: true description: |- The server_name of the homeserver on which the account has diff --git a/data/api/client-server/whoami.yaml b/data/api/client-server/whoami.yaml index 8f4027e73..55e5cb794 100644 --- a/data/api/client-server/whoami.yaml +++ b/data/api/client-server/whoami.yaml @@ -44,6 +44,8 @@ paths: properties: user_id: type: string + format: mx-user-id + pattern: "^@" description: The user ID that owns the access token. device_id: x-addedInMatrixVersion: "1.1" diff --git a/data/api/identity/definitions/request_email_validation.yaml b/data/api/identity/definitions/request_email_validation.yaml index a447c8710..f165c6ac2 100644 --- a/data/api/identity/definitions/request_email_validation.yaml +++ b/data/api/identity/definitions/request_email_validation.yaml @@ -23,6 +23,7 @@ properties: example: "monkeys_are_GREAT" email: type: string + format: email description: The email address to validate. example: "alice@example.org" send_attempt: @@ -39,6 +40,7 @@ properties: example: 1 next_link: type: string + format: uri description: |- Optional. When the validation is completed, the identity server will redirect the user to this URL. This option is ignored when submitting diff --git a/data/api/identity/definitions/request_msisdn_validation.yaml b/data/api/identity/definitions/request_msisdn_validation.yaml index 28544580d..5900e447f 100644 --- a/data/api/identity/definitions/request_msisdn_validation.yaml +++ b/data/api/identity/definitions/request_msisdn_validation.yaml @@ -44,6 +44,7 @@ properties: example: 1 next_link: type: string + format: uri description: |- Optional. When the validation is completed, the identity server will redirect the user to this URL. This option is ignored when submitting diff --git a/data/event-schemas/schema/m.identity_server.yaml b/data/event-schemas/schema/m.identity_server.yaml index acd0eb92a..1c08b047e 100644 --- a/data/event-schemas/schema/m.identity_server.yaml +++ b/data/event-schemas/schema/m.identity_server.yaml @@ -9,7 +9,10 @@ properties: type: object properties: base_url: - type: string + anyOf: + - type: string + format: uri + - type: "null" description: |- The URL of the identity server the user prefers to use, or `null` if the user does not want to use an identity server. This value is