From 29465f35198e3625079cc4c185902aff50e3ad10 Mon Sep 17 00:00:00 2001 From: Lukas Lihotzki Date: Mon, 9 Aug 2021 08:54:34 +0200 Subject: [PATCH] OpenAPI: use uri format In avatar_url, pusher url, wellknown base_url, getUrlPreview, and submit_url. Signed-off-by: Lukas Lihotzki --- data/api/client-server/administrative_contact.yaml | 1 + data/api/client-server/content-repo.yaml | 3 +++ data/api/client-server/definitions/public_rooms_response.yaml | 3 ++- data/api/client-server/definitions/request_token_response.yaml | 1 + data/api/client-server/definitions/wellknown/homeserver.yaml | 1 + .../client-server/definitions/wellknown/identity_server.yaml | 1 + data/api/client-server/profile.yaml | 3 +++ data/api/client-server/pusher.yaml | 2 ++ data/api/client-server/rooms.yaml | 1 + data/api/client-server/search.yaml | 1 + data/api/client-server/users.yaml | 1 + data/event-schemas/schema/m.room.member.yaml | 1 + 12 files changed, 18 insertions(+), 1 deletion(-) diff --git a/data/api/client-server/administrative_contact.yaml b/data/api/client-server/administrative_contact.yaml index 9966015b0..f1db14db9 100644 --- a/data/api/client-server/administrative_contact.yaml +++ b/data/api/client-server/administrative_contact.yaml @@ -154,6 +154,7 @@ paths: properties: submit_url: type: string + format: uri description: |- An optional field containing a URL where the client must submit the validation token to, with identical parameters diff --git a/data/api/client-server/content-repo.yaml b/data/api/client-server/content-repo.yaml index c36fa837d..fb91c7c53 100644 --- a/data/api/client-server/content-repo.yaml +++ b/data/api/client-server/content-repo.yaml @@ -66,6 +66,7 @@ paths: properties: content_uri: type: string + format: uri description: "The [MXC URI](/client-server-api/#matrix-content-mxc-uris) to the uploaded content." examples: application/json: { @@ -360,6 +361,7 @@ paths: parameters: - in: query type: string + format: uri x-example: "https://matrix.org" name: url description: "The URL to get a preview of." @@ -389,6 +391,7 @@ paths: The byte-size of the image. Omitted if there is no image attached. "og:image": type: string + format: uri description: |- An [MXC URI](/client-server-api/#matrix-content-mxc-uris) to the image. Omitted if there is no image. examples: diff --git a/data/api/client-server/definitions/public_rooms_response.yaml b/data/api/client-server/definitions/public_rooms_response.yaml index 8cf9935c2..406f83b0e 100644 --- a/data/api/client-server/definitions/public_rooms_response.yaml +++ b/data/api/client-server/definitions/public_rooms_response.yaml @@ -68,6 +68,7 @@ properties: rules like any other user. avatar_url: type: string + format: uri description: The URL for the room's avatar, if one is set. join_rule: type: string @@ -110,4 +111,4 @@ example: { "next_batch": "p190q", "prev_batch": "p1902", "total_room_count_estimate": 115 -} \ No newline at end of file +} diff --git a/data/api/client-server/definitions/request_token_response.yaml b/data/api/client-server/definitions/request_token_response.yaml index b801af984..aa9379f6f 100644 --- a/data/api/client-server/definitions/request_token_response.yaml +++ b/data/api/client-server/definitions/request_token_response.yaml @@ -22,6 +22,7 @@ properties: example: "123abc" submit_url: type: string + format: uri description: |- An optional field containing a URL where the client must submit the validation token to, with identical parameters to the Identity Service diff --git a/data/api/client-server/definitions/wellknown/homeserver.yaml b/data/api/client-server/definitions/wellknown/homeserver.yaml index 92ff34ed3..6f6d3cb9a 100644 --- a/data/api/client-server/definitions/wellknown/homeserver.yaml +++ b/data/api/client-server/definitions/wellknown/homeserver.yaml @@ -18,6 +18,7 @@ type: object properties: base_url: type: string + format: uri description: The base URL for the homeserver for client-server connections. example: https://matrix.example.com required: diff --git a/data/api/client-server/definitions/wellknown/identity_server.yaml b/data/api/client-server/definitions/wellknown/identity_server.yaml index a8f7c31cf..a86ad8b1b 100644 --- a/data/api/client-server/definitions/wellknown/identity_server.yaml +++ b/data/api/client-server/definitions/wellknown/identity_server.yaml @@ -18,6 +18,7 @@ type: object properties: base_url: type: string + format: uri description: The base URL for the identity server for client-server connections. example: https://identity.example.com required: diff --git a/data/api/client-server/profile.yaml b/data/api/client-server/profile.yaml index 6a8d6a775..d1d4306cf 100644 --- a/data/api/client-server/profile.yaml +++ b/data/api/client-server/profile.yaml @@ -129,6 +129,7 @@ paths: properties: avatar_url: type: string + format: uri description: The new avatar URL for this user. responses: 200: @@ -170,6 +171,7 @@ paths: properties: avatar_url: type: string + format: uri description: The user's avatar URL if they have set one, otherwise not present. 404: description: There is no avatar URL for this user or this user does not exist. @@ -204,6 +206,7 @@ paths: properties: avatar_url: type: string + format: uri description: The user's avatar URL if they have set one, otherwise not present. displayname: type: string diff --git a/data/api/client-server/pusher.yaml b/data/api/client-server/pusher.yaml index 69882066f..9feccb4f0 100644 --- a/data/api/client-server/pusher.yaml +++ b/data/api/client-server/pusher.yaml @@ -113,6 +113,7 @@ paths: properties: url: type: string + format: uri description: |- Required if `kind` is `http`. The URL to use to send notifications to. @@ -220,6 +221,7 @@ paths: properties: url: type: string + format: uri description: |- Required if `kind` is `http`. The URL to use to send notifications to. MUST be an HTTPS URL with a path of diff --git a/data/api/client-server/rooms.yaml b/data/api/client-server/rooms.yaml index f8931893e..2f161e2bf 100644 --- a/data/api/client-server/rooms.yaml +++ b/data/api/client-server/rooms.yaml @@ -303,6 +303,7 @@ paths: description: The display name of the user this object is representing. avatar_url: type: string + format: uri description: The mxc avatar url of the user this object is representing. description: A map from user ID to a RoomMember object. type: object diff --git a/data/api/client-server/search.yaml b/data/api/client-server/search.yaml index 1dc9804e2..8bc255286 100644 --- a/data/api/client-server/search.yaml +++ b/data/api/client-server/search.yaml @@ -238,6 +238,7 @@ paths: title: Display name avatar_url: type: string + format: uri title: Avatar Url events_before: type: array diff --git a/data/api/client-server/users.yaml b/data/api/client-server/users.yaml index 31bc971c8..4a264f3a1 100644 --- a/data/api/client-server/users.yaml +++ b/data/api/client-server/users.yaml @@ -96,6 +96,7 @@ paths: description: The display name of the user, if one exists. avatar_url: type: string + format: uri example: "mxc://bar.com/foo" description: The avatar url, as an MXC, if one exists. limited: diff --git a/data/event-schemas/schema/m.room.member.yaml b/data/event-schemas/schema/m.room.member.yaml index 928e1528f..37975cbe1 100644 --- a/data/event-schemas/schema/m.room.member.yaml +++ b/data/event-schemas/schema/m.room.member.yaml @@ -45,6 +45,7 @@ properties: avatar_url: description: 'The avatar URL for this user, if any.' type: string + format: uri displayname: description: 'The display name for this user, if any.' type: