-
-
Notifications
You must be signed in to change notification settings - Fork 97
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
Fix endpoints that only differ by a trailing variable #443
Comments
Considering we're a RESTful API, I think standard rules apply. |
Ideally, but we should just really be changing things to |
Sure, but we decided that an empty string is a valid state key so that rule doesn't apply in many cases. |
ftr the context for this is matrix-org/synapse#3622 where we're trying to remove trailing slashes from some endpoints (including However should |
So after a bunch of research, people are divided on the issue. It ends up being a contextual judgement call. The recommendation with a 51% majority is:
So following the principles of common sense:
I'm not really sure how much it makes sense to put this into the spec though. Technically speaking, the routes are all defined without trailing slashes so there's arguably no expectation for implementations to consider |
In the case of |
Some of the endpoints are differentiated simply by lack of a variable on the end. This is bad because you get into the question of what to do when you have the following endpoint definitions:
/_matrix/some/endpoint
/_matrix/some/endpoint/$var
and you get a request that looks like:
/_matrix/some/endpoint/
Does this match the first definition? Or the second definition with
$var
=""
? To make matters worse sometimes""
is a valid value!This is currently noticed in the following endpoints, but there may be more:
Specced (as of this issue):
GET /_matrix/client/r0/rooms/{roomId}/state/{eventType}/{stateKey}
GET /_matrix/client/r0/rooms/{roomId}/state/{eventType}
GET /_matrix/client/r0/user/{userId}/filter/
GET /_matrix/client/r0/user/{userId}/filter/{filter}
Unspecced (as of this issue):
GET /_matrix/federation/v1/groups/{groupId}/categories/
GET /_matrix/federation/v1/groups/{groupId}/categories/{categoryId}
GET /_matrix/federation/v1/groups/{groupId}/roles/
GET /_matrix/federation/v1/groups/{groupId}/roles/{roleId}
The text was updated successfully, but these errors were encountered: