-
Notifications
You must be signed in to change notification settings - Fork 385
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
New /publicRoom APIs #388
New /publicRoom APIs #388
Conversation
be36729
to
df66ebe
Compare
df66ebe
to
130ea85
Compare
@dbkr Can you just sanity check that it matches your understanding? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some nit-pickery. I realise that partly I'm requesting changes to existing stuff, but (a) it's a good opportunity to fix it, and (b) you're c&ping the broken stuff and I'd prefer not to see it spread.
A bunch of the comments apply to the POST version as well as the GET version.
canonical_alias: | ||
type: string | ||
description: |- | ||
The canonical alias of the room, if any. May be null. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Null, but not absent? I thought we avoided nulls in the API. If it really can be null rather than absent, it needs adding to required
and to the example.
Ditto name
, topic
, etc, and ditto in the POST API.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed to be optional rather than null.
type: string | ||
description: |- | ||
The name of the room, if any. May be null. | ||
num_joined_members: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this required? Needs adding to required
if so; otherwise could do with explictly saying it's optional.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added.
type: string | ||
description: |- | ||
A pagination token for the response, if there are any more results. | ||
total_room_count_estimate: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
required? optional?
400: | ||
description: > | ||
The request body is malformed or the room alias specified is already taken. | ||
post: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
feels like POST /_matrix/client/unstable/publicRooms
should be for adding rooms to the list. I don't really have any better suggestions though :/.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed :/
type: string | ||
description: |- | ||
A pagination token for the response, if there are any more results. | ||
prev_batch: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what's this for? next_batch
I get, but not prev_batch
. It sounds like there might be requirements on the server which aren't being made explicit here?
description: |- | ||
Optional filtering of the returned rooms. | ||
properties: | ||
generic_search_term: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
required? optional?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I appended (Optional)
to the description, since I can't explicitly say required: []
at the top level :/
next_batch: | ||
type: string | ||
description: |- | ||
A pagination token for the response, if there are any more results. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's be more explicit here: a client determines that they have reached the end of the list by the absence of next_batch
?
Also: needs a changelog entry, please. |
e0f329f
to
e854757
Compare
@richvdh PTAL |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sorry, still fonxing this on the null
fields situation
A pagination token for the response. | ||
A pagination token that allows fetching previous results. The | ||
absence of this token means there are no results before this | ||
batch, i.e. this is the first batch. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah; is the direction of pagination implied in the token, unlike other APIs where there is an explicit direction
flag? might be worth emphasising that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've updated to mention this.
@@ -35,6 +35,8 @@ | |||
- Add top-level ``account_data`` key to the responses to ``GET /sync`` and | |||
``GET /initialSync`` | |||
(`#380 <https://github.com/matrix-org/matrix-doc/pull/380>`_). | |||
- Add pagination and filter support to ``/publicRooms`` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
... and more details in the response?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added more details
name: since | ||
type: string | ||
description: |- | ||
A pagination token from a previous request, allowing clients to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe worth clarifying that this can be either a prev or next token?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(done)
type: string | ||
description: |- | ||
A pagination token from a previous request, allowing clients to | ||
get the next batch of rooms. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
or previous
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
or previous
} | ||
400: | ||
description: > | ||
The request body is malformed or the room alias specified is already taken. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't sound right. There is no request body for a GET, and there is no specified room alias.
Similarly on the POST endpoint.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(done)
400: | ||
description: > | ||
The request body is malformed or the room alias specified is already taken. | ||
post: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
GET endpoint is missing tags
A pagination token that allows fetching previous results. The | ||
absence of this token means there are no results before this | ||
batch, i.e. this is the first batch. | ||
The direction of pagination is specified solely by which token |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this would make more sense on the since
parameter than here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(done)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not done. Needs doing on the POST endpoint too.
type: object | ||
title: "Filter" | ||
description: |- | ||
Optional filtering of the returned rooms. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think "Filter to apply to the results" reads better. No need to emphasise that it is optional (particularly since you don't for since
and limit
).
type: number | ||
description: |- | ||
Limit the number of results returned, ordered by number of | ||
memebers in the room. Defaults to no limit. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"memebers"
type: string | ||
description: |- | ||
A pagination token from a previous request, allowing clients to | ||
get the next batch of rooms. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
or previous
type: number | ||
description: |- | ||
Limit the number of results returned, ordered by number of | ||
memebers in the room. Defaults to no limit. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"memebers"
name: limit | ||
type: number | ||
description: |- | ||
Limit the number of results returned, ordered by number of |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we return the busiest or least busy rooms? I'm assuming the former, but be explicit please.
Joined members? Invited members? Banned/left members?
Are the results returned ordered by number of members, or does this just apply to the limit? If the former, this should go elsewhere. If the latter, you probably want something like "Limit for the number of results returned. If there are more results, the rooms with the {most|fewest} members will be returned. By default, there is no limit." (You probably want that anyway).
Ditto for the POST API.
* order by *joined* members * clarify pagination direction behaviour
No description provided.