Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Define a 400 response from {PUT,GET,DELETE} `/directory/rooms/{roomAlias}`.
27 changes: 27 additions & 0 deletions data/api/client-server/directory.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,15 @@ paths:
application/json: {}
schema:
type: object
400:
description: The given `roomAlias` is not a valid room alias.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Define valid". We can probably copy a lot of the text from #1261 and use it here.

Generally though, I'm more in favour of fixing the spec to say that 400 M_INVALID_PARAM is something which can appear on every endpoint rather than each endpoint individually. This is likely a larger effort than this PR should take on, however.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would ideally link to https://spec.matrix.org/latest/appendices/#room-aliases here, but I couldn't find an example of such a hyperlink from the OpenAPI spec.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is

(see also: https://spec.matrix.org/v1.2/appendices/#signing-json)
but this a) is hardcoded to a spec version and b) doesn't appear in the spec (#1287)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, directly above this:

by the [key algorithm](/client-server-api/#key-algorithms).

That'll do.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is

(see also: https://spec.matrix.org/v1.2/appendices/#signing-json)

but this a) is hardcoded to a spec version and b) doesn't appear in the spec (#1287)

This looks like a bug, ftr. Will take a look.

examples:
application/json: {
"errcode": "M_INVALID_PARAM",
"error": "Room alias invalid"
}
schema:
"$ref": "definitions/errors/error.yaml"
409:
description: A room alias with that name already exists.
examples:
Expand Down Expand Up @@ -113,6 +122,15 @@ paths:
"another.com"
]
}
400:
description: The given `roomAlias` is not a valid room alias.
examples:
application/json: {
"errcode": "M_INVALID_PARAM",
"error": "Room alias invalid"
}
schema:
"$ref": "definitions/errors/error.yaml"
404:
description: There is no mapped room ID for this room alias.
examples:
Expand Down Expand Up @@ -220,6 +238,15 @@ paths:
items:
type: string
required: ['aliases']
400:
description: The given `roomAlias` is not a valid room alias.
examples:
application/json: {
"errcode": "M_INVALID_PARAM",
"error": "Room alias invalid"
}
schema:
"$ref": "definitions/errors/error.yaml"
403:
description: The user is not permitted to retrieve the list of local aliases for the room.
examples:
Expand Down