matrix-org / matrix-org/matrix-spec

Fix endpoints that only differ by a trailing variable

Open
#443 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

A-Application-Services A-Client-Server A-Identity-Service A-S2S clarification
Dominant language
HTML
Stars
330
Forks
150
Avg merge
2h 21m
Merged PRs (30d)
3

Description

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}

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the Matrix client and federation endpoint definitions listed in the issue, comparing each pair that differs only by a trailing variable or slash. Check whether other endpoint pairs have the same ambiguity; done means the affected definitions consistently distinguish the no-variable and variable forms without leaving the empty-value behavior unclear.

Written by the indexing model from the issue text.

Assessment

Tech stack
html
Domain
api, documentation
Issue type
Documentation
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.