-
Notifications
You must be signed in to change notification settings - Fork 380
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
Merged
Merged
add user_directory #1096
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
9744519
add user_directory
t3chguy 1f7d4cd
add changelog entry
t3chguy b80f38e
fix changelog entry
t3chguy d219cbc
apply points from review
t3chguy 605510e
Merge branch 'master' into user_directory
t3chguy 3d8fe6e
merge profiles with user directory into user data, also fix typo
t3chguy 784adad
changes based on Pull Request feedback
t3chguy File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
# Copyright 2017 New Vector Ltd | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
swagger: '2.0' | ||
info: | ||
title: "Matrix Client-Server User Directory API" | ||
version: "1.0.0" | ||
host: localhost:8008 | ||
schemes: | ||
- https | ||
- http | ||
basePath: /_matrix/client/%CLIENT_MAJOR_VERSION% | ||
consumes: | ||
- application/json | ||
produces: | ||
- application/json | ||
securityDefinitions: | ||
$ref: definitions/security.yaml | ||
paths: | ||
"/user_directory/search": | ||
post: | ||
summary: Searches the user directory. | ||
description: |- | ||
This API performs a server-side search over all users registered on the server. | ||
It searches user ID and displayname case-insensitively for users that you share a room with or that are in public rooms. | ||
operationId: searchUserDirectory | ||
security: | ||
- accessToken: [] | ||
parameters: | ||
- in: body | ||
name: body | ||
schema: | ||
type: object | ||
properties: | ||
search_term: | ||
type: string | ||
description: The term to search for | ||
example: "foo" | ||
limit: | ||
type: number | ||
description: The maximum number of results to return (Defaults to 10). | ||
example: 10 | ||
required: ["search_term"] | ||
responses: | ||
200: | ||
description: The results of the search. | ||
examples: | ||
application/json: { | ||
"results": [ | ||
{ | ||
"user_id": "@foo:bar.com", | ||
"display_name": "Foo", | ||
"avatar_url": "mxc://bar.com/foo" | ||
} | ||
], | ||
"limited": false | ||
} | ||
schema: | ||
type: object | ||
required: ["results", "limited"] | ||
properties: | ||
results: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 commentThe reason will be displayed to describe this comment to others. Learn more. vaguely, seems implementation specific |
||
type: array | ||
description: Ordered by rank and then whether or not profile info is available. | ||
items: | ||
title: User | ||
type: object | ||
required: ["user_id"] | ||
properties: | ||
user_id: | ||
type: string | ||
example: "@foo:bar.com" | ||
description: The user's matrix user ID. | ||
display_name: | ||
type: string | ||
example: "Foo" | ||
description: The display name of the user, if one exists. | ||
avatar_url: | ||
type: string | ||
example: "mxc://bar.com/foo" | ||
description: The avatar url, as an MXC, if one exists. | ||
limited: | ||
type: boolean | ||
description: Indicates if the result list has been truncated by the limit. | ||
429: | ||
description: This request was rate-limited. | ||
schema: | ||
"$ref": "definitions/error.yaml" | ||
tags: | ||
- User data |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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