Improve documentation of /directory/list

* 404 for room not found instead of 400
* GET doesn't require an access token
* PUT (and therefore DELETE) can have it's own access control checks
* DELETE is implemented because of synapse

Signed-off-by: Travis Ralston <travpc@gmail.com>
pull/1141/head
Travis Ralston 7 years ago
parent 709fca8190
commit 5cbfa73fe4

@ -31,8 +31,6 @@ paths:
description: |- description: |-
Gets the visibility of a given room on the server's public room directory. Gets the visibility of a given room on the server's public room directory.
operationId: getRoomVisibilityOnDirectory operationId: getRoomVisibilityOnDirectory
security:
- accessToken: []
parameters: parameters:
- in: path - in: path
type: string type: string
@ -54,11 +52,11 @@ paths:
application/json: { application/json: {
"visibility": "public" "visibility": "public"
} }
400: 404:
description: The room is not known to the server description: The room is not known to the server
examples: examples:
application/json: { application/json: {
"errcode": "M_UNKNOWN", "errcode": "M_NOT_FOUND",
"error": "Room not found" "error": "Room not found"
} }
put: put:
@ -66,6 +64,10 @@ paths:
description: |- description: |-
Sets the visibility of a given room in the server's public room Sets the visibility of a given room in the server's public room
directory. directory.
Servers may choose to implement additional access control checks
here, for instance that room visibility can only be changed by
the room creator or a server administrator.
operationId: setRoomVisibilityOnDirectory operationId: setRoomVisibilityOnDirectory
security: security:
- accessToken: [] - accessToken: []
@ -99,18 +101,19 @@ paths:
examples: examples:
application/json: { application/json: {
} }
400: 404:
description: The room is not known to the server description: The room is not known to the server
examples: examples:
application/json: { application/json: {
"errcode": "M_UNKNOWN", "errcode": "M_NOT_FOUND",
"error": "Room not found" "error": "Room not found"
} }
delete: delete:
summary: Sets a room to be private on the room directory summary: Sets a room to be private on the room directory
description: |- description: |-
Updates the visibility of a room to be private on the server's room Updates the visibility of a room to be private on the server's room
directory. directory. This is the same as using the PUT operation with a private
as the visibility.
operationId: setRoomPrivateOnDirectory operationId: setRoomPrivateOnDirectory
security: security:
- accessToken: [] - accessToken: []
@ -127,11 +130,11 @@ paths:
examples: examples:
application/json: { application/json: {
} }
400: 404:
description: The room is not known to the server description: The room is not known to the server
examples: examples:
application/json: { application/json: {
"errcode": "M_UNKNOWN", "errcode": "M_NOT_FOUND",
"error": "Room not found" "error": "Room not found"
} }
"/publicRooms": "/publicRooms":

Loading…
Cancel
Save