Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Define a 400 response from {PUT,GET,DELETE} /directory/rooms/{roomAlias} #1286

Merged
merged 4 commits into from
Oct 17, 2022
Merged

Define a 400 response from {PUT,GET,DELETE} /directory/rooms/{roomAlias} #1286

merged 4 commits into from
Oct 17, 2022

Conversation

DMRobertson
Copy link
Contributor

@DMRobertson DMRobertson commented Oct 13, 2022

Noticed when comparing Synapse against the spec in matrix-org/synapse#14176.

Not important, maybe a nice-to-have?

Preview: https://pr1286--matrix-spec-previews.netlify.app

@DMRobertson DMRobertson marked this pull request as ready for review October 13, 2022 21:45
@DMRobertson DMRobertson requested a review from a team as a code owner October 13, 2022 21:45
Copy link
Member

@turt2live turt2live left a comment

Choose a reason for hiding this comment

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

otherwise lgtm

@@ -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.

changelogs/client_server/newsfragments/1286.clarification Outdated Show resolved Hide resolved
DMRobertson and others added 2 commits October 13, 2022 22:50
Co-authored-by: Travis Ralston <travpc@gmail.com>
@DMRobertson
Copy link
Contributor Author

I have snuck-in a recommendation that clients URL-encode the hash character: 36aeb1c (#1286)

@turt2live
Copy link
Member

I have snuck-in a recommendation that clients URL-encode the hash character: 36aeb1c (#1286)

I don't think that's a thing that should be snuck in here - it sounds like "do http correctly" which is out of scope for our spec.

@DMRobertson
Copy link
Contributor Author

Fair enough; that's reverted.

@turt2live
Copy link
Member

(please don't force push after review is given - it makes things harder on everyone)

@turt2live turt2live merged commit ad99be4 into matrix-org:main Oct 17, 2022
clokep pushed a commit to clokep/matrix-spec that referenced this pull request May 3, 2023
…ias}` (matrix-org#1286)

* Define a 400 response from {PUT,GET,DELETE} `/directory/rooms/{roomAlias}`

* Changelog

* Adjust changelog

Co-authored-by: Travis Ralston <travpc@gmail.com>

* Refer to appendices

Co-authored-by: Travis Ralston <travpc@gmail.com>
S7evinK added a commit to matrix-org/dendrite that referenced this pull request Jan 9, 2024
…#3297)

Part of #3223
(matrix-org/matrix-spec#1286)

(For `DELETE` we don't validate the alias, but just return a 404 if we
can't find it)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants