-
Notifications
You must be signed in to change notification settings - Fork 376
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
add user_directory #1096
add user_directory #1096
Conversation
|
I think this fixes #953 |
api/client-server/users.yaml
Outdated
@@ -0,0 +1,93 @@ | |||
# Copyright 2016 OpenMarket Ltd |
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.
it's not 2016, and you don't work for openmarket. (you may be after New Vector Ltd or Michael Telatynski, depending which hat you feel like wearing)
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.
the woes of Copying entire files and my IDE collapsing the header and never actually seeing this
api/client-server/users.yaml
Outdated
# limitations under the License. | ||
swagger: '2.0' | ||
info: | ||
title: "Matrix Client-Server Profile 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.
not the profile api
changelogs/client_server.rst
Outdated
@@ -76,6 +76,9 @@ r0.3.0 | |||
- ``GET /media/{version}/preview_url`` | |||
(`#1064 <https://github.com/matrix-org/matrix-doc/pull/1064>`_). | |||
|
|||
- ``POST /user_directory/search`` |
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.
Needs to go under 'unreleased changes', please.
$ref: definitions/security.yaml | ||
paths: | ||
"/user_directory/search": | ||
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.
as Travis says, this is missing its operationId
.
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
api/client-server/users.yaml
Outdated
required: ["search_term"] | ||
responses: | ||
200: | ||
description: The results of the paginated search. |
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.
erm, "the paginated results of the search", surely. Or probably just "The results of the search".
api/client-server/users.yaml
Outdated
example: "foo" | ||
limit: | ||
type: number | ||
description: The maximum number of results to return |
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.
if this is optional, what's the behaviour when it's omitted?
api/client-server/users.yaml
Outdated
post: | ||
summary: Searches the user directory. | ||
description: |- | ||
This API paginates over search results of the user directory. |
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 emphasises the pagination too strongly. Not least because aiui pagination isn't currently supported. How about "Performs a server-side search over all users registered on the server".
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.
could you also give some details about how the search works. Is it case-sensitive? Does it search displayname, mxid, both?
api/client-server/users.yaml
Outdated
items: | ||
title: User | ||
type: object | ||
properties: |
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 user_id
not required here?
type: object | ||
required: ["results", "limited"] | ||
properties: | ||
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.
do we know anything about the ordering of the 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.
vaguely, seems implementation specific
specification/client_server_api.rst
Outdated
@@ -1335,6 +1335,13 @@ Listing rooms | |||
|
|||
{{list_public_rooms_cs_http_api}} | |||
|
|||
|
|||
Users |
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 it might be worth merging this and profiles into a generic user data
section.
back to you @richvdh |
api/client-server/users.yaml
Outdated
This API paginates over search results of the user directory. | ||
This API performs a server-side search over all users registered on the server. | ||
Searches MXID and displayname case-insesitively for users that you share a room with or that are in public rooms. | ||
operationId: postUserDirectorySearch |
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.
why postUserDirectorySearch? seems inconsistent with everything else.
api/client-server/users.yaml
Outdated
@@ -31,7 +31,9 @@ paths: | |||
post: | |||
summary: Searches the user directory. | |||
description: |- | |||
This API paginates over search results of the user directory. | |||
This API performs a server-side search over all users registered on the server. | |||
Searches MXID and displayname case-insesitively for users that you share a room with or that are in public 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.
insesitively
api/client-server/users.yaml
Outdated
@@ -31,7 +31,9 @@ paths: | |||
post: | |||
summary: Searches the user directory. | |||
description: |- | |||
This API paginates over search results of the user directory. | |||
This API performs a server-side search over all users registered on the server. | |||
Searches MXID and displayname case-insesitively for users that you share a room with or that are in public 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.
full sentence here please.
api/client-server/users.yaml
Outdated
@@ -46,12 +48,12 @@ paths: | |||
example: "foo" | |||
limit: | |||
type: number | |||
description: The maximum number of results to return | |||
description: The maximum number of results to return (10 if omitted), with a maximum of 50 |
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'm not sure that the maximum here needs speccing, and if it does, it probably belongs in a note in the api description rather than that of the summary.
api/client-server/users.yaml
Outdated
@@ -46,12 +48,12 @@ paths: | |||
example: "foo" | |||
limit: | |||
type: number | |||
description: The maximum number of results to return | |||
description: The maximum number of results to return (10 if omitted), with a maximum of 50 |
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.
suggest you use 'Defaults to 10' instead of (10 if omitted)
.
rav@fred:~/work/matrix-doc (master $%=)$ grep -ir 'if omitted' api/client-server/ | wc -l
1
rav@fred:~/work/matrix-doc (master $%=)$ grep -ir 'Defaults to' api/client-server/ | wc -l
6
api/client-server/users.yaml
Outdated
@@ -46,12 +48,12 @@ paths: | |||
example: "foo" | |||
limit: | |||
type: number | |||
description: The maximum number of results to return | |||
description: The maximum number of results to return (10 if omitted), with a maximum of 50 |
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.
we seem to be using full-stops on these descriptions in general
api/client-server/users.yaml
Outdated
@@ -31,7 +31,9 @@ paths: | |||
post: | |||
summary: Searches the user directory. | |||
description: |- | |||
This API paginates over search results of the user directory. | |||
This API performs a server-side search over all users registered on the server. | |||
Searches MXID and displayname case-insesitively for users that you share a room with or that are in public 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.
MXID isn't actually used very much in the spec (and where it is, I think it's a bug). Suggest 'user ID'.
api/client-server/users.yaml
Outdated
properties: | ||
user_id: | ||
type: string | ||
example: "@foo:bar.com" | ||
description: The MXID of the user. |
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.
"The user's matrix user ID"
specification/client_server_api.rst
Outdated
|
||
{{users_cs_http_api}} | ||
|
||
|
||
Profiles | ||
-------- | ||
~~~~~~~~ |
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.
"Events on Change of Profile Information" is no longer included under "Profiles", which seems odd
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.
\o/ perfect
This was added to synapse in matrix-org/synapse#2252, ftr |
No description provided.