From 870d1b894456a0f6f17be35752225def432a10c3 Mon Sep 17 00:00:00 2001 From: Kegan Dougal Date: Fri, 29 May 2015 14:31:05 +0100 Subject: [PATCH] Add Swagger 2 directory API. --- api/client-server/v1/directory.yaml | 77 +++++++++++++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 api/client-server/v1/directory.yaml diff --git a/api/client-server/v1/directory.yaml b/api/client-server/v1/directory.yaml new file mode 100644 index 00000000..806bf515 --- /dev/null +++ b/api/client-server/v1/directory.yaml @@ -0,0 +1,77 @@ +swagger: '2.0' +info: + title: "Matrix Client-Server v1 Directory API" + version: "1.0.0" +host: matrix.org +schemes: + - https + - http +basePath: /_matrix/client/api/v1/directory +consumes: + - application/json +produces: + - application/json +paths: + "/room/{roomAlias}": + put: + summary: Create a new mapping from room alias to room ID. + parameters: + - in: path + type: string + name: roomAlias + description: The room alias to set. + required: true + - in: body + name: roomInfo + description: Information about this room alias. + required: true + schema: + type: object + properties: + room_id: + type: string + description: The room ID to set. + responses: + 200: + description: The mapping was created. + schema: + type: object # empty json object + get: + summary: Get the room ID corresponding to this room alias. + parameters: + - in: path + type: string + name: roomAlias + description: The room alias. + required: true + responses: + 200: + description: The room ID and other information for this alias. + schema: + type: object + properties: + room_id: + type: string + description: The room ID for this room alias. + servers: + type: array + description: A list of servers that are aware of this room ID. + items: + type: string + description: A server which is aware of this room ID. + 404: + description: There is no mapped room ID for this room alias. + delete: + summary: Remove a mapping of room alias to room ID. + parameters: + - in: path + type: string + name: roomAlias + description: The room alias to remove. + required: true + responses: + 200: + description: The mapping was removed. + schema: + type: object # empty json object +