/join and /room/:roomId/join aren't exact aliases

Separate them, clarify their differences.

Also, fix some links which weren't being properly populated.
This commit is contained in:
Daniel Wagner-Hall 2016-01-13 15:55:51 +00:00 committed by review.rocks
parent 367e1334eb
commit 1e2b63763e
4 changed files with 63 additions and 30 deletions

View file

@ -22,20 +22,70 @@ paths:
post: post:
summary: Start the requesting user participating in a particular room. summary: Start the requesting user participating in a particular room.
description: |- description: |-
*Note that this API requires a room ID, not alias.* ``/join/{roomIdOrAlias}`` *exists if you have a room alias.*
This API starts a user participating in a particular room, if that user This API starts a user participating in a particular room, if that user
is allowed to participate in that room. After this call, the client is is allowed to participate in that room. After this call, the client is
allowed to see all current state events in the room, and all subsequent allowed to see all current state events in the room, and all subsequent
events associated with the room until the user leaves the room. events associated with the room until the user leaves the room.
After a user has joined a room, the room will appear as an entry in the After a user has joined a room, the room will appear as an entry in the
response of the |initialSync| API. response of the |/initialSync|_ and |/sync|_ APIs.
security: security:
- accessToken: [] - accessToken: []
parameters: parameters:
- in: path - in: path
type: string type: string
name: roomId name: roomId
description: The room identifier or room alias to join. description: The room identifier (not alias) to join.
required: true
x-example: "!d41d8cd:matrix.org"
responses:
200:
description: |-
The room has been joined.
The joined room ID must be returned in the ``room_id`` field.
examples:
application/json: |-
{"room_id": "!d41d8cd:matrix.org"}
schema:
type: object
403:
description: |-
You do not have permission to join the room. A meaningful ``errcode`` and description error text will be returned. Example reasons for rejection are:
- The room is invite-only and the user was not invited.
- The user has been banned from the room.
examples:
application/json: |-
{"errcode": "M_FORBIDDEN", "error": "You are not invited to this room."}
429:
description: This request was rate-limited.
schema:
"$ref": "definitions/error.yaml"
tags:
- Room membership
"/join/{roomIdOrAlias}":
post:
summary: Start the requesting user participating in a particular room.
description: |-
*Note that this API takes either a room ID or alias, unlike* ``/room/{roomId}/join``.
This API starts a user participating in a particular room, if that user
is allowed to participate in that room. After this call, the client is
allowed to see all current state events in the room, and all subsequent
events associated with the room until the user leaves the room.
After a user has joined a room, the room will appear as an entry in the
response of the |/initialSync|_ and |/sync|_ APIs.
security:
- accessToken: []
parameters:
- in: path
type: string
name: roomIdOrAlias
description: The room identifier or alias to join.
required: true required: true
x-example: "#monkeys:matrix.org" x-example: "#monkeys:matrix.org"
responses: responses:
@ -62,9 +112,5 @@ paths:
description: This request was rate-limited. description: This request was rate-limited.
schema: schema:
"$ref": "definitions/error.yaml" "$ref": "definitions/error.yaml"
x-alias:
canonical-link: "post-matrix-client-%CLIENT_MAJOR_VERSION%-rooms-roomid-join"
aliases:
- /_matrix/client/%CLIENT_MAJOR_VERSION%/join/{roomId}
tags: tags:
- Room membership - Room membership

View file

@ -605,8 +605,8 @@ point in time::
Clients can add to the stream by PUTing message or state events, and can read Clients can add to the stream by PUTing message or state events, and can read
from the stream via the from the stream via the
|initialSync|_, |/initialSync|_,
|events|_, |/events|_,
|/rooms/<room_id>/initialSync|_, and |/rooms/<room_id>/initialSync|_, and
|/rooms/<room_id>/messages|_ |/rooms/<room_id>/messages|_
APIs. APIs.
@ -922,7 +922,7 @@ Leaving rooms
A user can leave a room to stop receiving events for that room. A user must A user can leave a room to stop receiving events for that room. A user must
have been invited to or have joined the room before they are eligible to leave have been invited to or have joined the room before they are eligible to leave
the room. Leaving a room to which the user has been invited rejects the invite. the room. Leaving a room to which the user has been invited rejects the invite.
Once a user leaves a room, it will no longer appear on the |initialSync|_ API. Once a user leaves a room, it will no longer appear on the |/initialSync|_ API.
Whether or not they actually joined the room, if the room is Whether or not they actually joined the room, if the room is
an "invite-only" room they will need to be re-invited before they can re-join an "invite-only" room they will need to be re-invited before they can re-join
@ -1012,11 +1012,14 @@ have to wait in milliseconds before they can try again.
.. Links through the external API docs are below .. Links through the external API docs are below
.. ============================================= .. =============================================
.. |initialSync| replace:: ``/initialSync`` .. |/initialSync| replace:: ``/initialSync``
.. _initialSync: #get-matrix-client-%CLIENT_MAJOR_VERSION%-initialsync .. _/initialSync: #get-matrix-client-%CLIENT_MAJOR_VERSION%-initialsync
.. |events| replace:: ``/events`` .. |/sync| replace:: ``/sync``
.. _events: #get-matrix-client-%CLIENT_MAJOR_VERSION%-events .. _/sync: #get-matrix-client-%CLIENT_MAJOR_VERSION%-sync
.. |/events| replace:: ``/events``
.. _/events: #get-matrix-client-%CLIENT_MAJOR_VERSION%-events
.. |/rooms/<room_id>/initialSync| replace:: ``/rooms/<room_id>/initialSync`` .. |/rooms/<room_id>/initialSync| replace:: ``/rooms/<room_id>/initialSync``
.. _/rooms/<room_id>/initialSync: #get-matrix-client-%CLIENT_MAJOR_VERSION%-rooms-roomid-initialsync .. _/rooms/<room_id>/initialSync: #get-matrix-client-%CLIENT_MAJOR_VERSION%-rooms-roomid-initialsync

View file

@ -7,11 +7,6 @@
This API is deprecated and will be removed from a future release. This API is deprecated and will be removed from a future release.
{% endif -%} {% endif -%}
{% if "alias_for_path" in endpoint -%}
``{{endpoint.path}}`` is an alias for `{{endpoint.alias_for_path}}`_.
.. _`{{endpoint.alias_for_path}}`: #{{endpoint.alias_link}}
{% else -%}
{{endpoint.desc | wrap(80)}} {{endpoint.desc | wrap(80)}}
@ -67,4 +62,4 @@ Example
{{res["example"] | indent_block(2)}} {{res["example"] | indent_block(2)}}
{% endfor %} {% endfor %}
{% endif -%}

View file

@ -440,17 +440,6 @@ class MatrixUnits(Units):
endpoints.append(endpoint) endpoints.append(endpoint)
aliases = single_api.get("x-alias", None)
if aliases:
alias_link = aliases["canonical-link"]
for alias in aliases["aliases"]:
endpoints.append({
"method": method.upper(),
"path": alias,
"alias_for_path": full_path,
"alias_link": alias_link
})
return { return {
"base": api.get("basePath").rstrip("/"), "base": api.get("basePath").rstrip("/"),
"group": group_name, "group": group_name,