diff --git a/appapi.yaml b/appapi.yaml index f22166f3a379aaad1952dadc3fca16ac27c325a5..71556bb4558a2276a11fac2b98aec6a423cbb79e 100755 --- a/appapi.yaml +++ b/appapi.yaml @@ -83,6 +83,56 @@ paths: application/json: schema: $ref: '#/components/schemas/error' + '/user/search': + get: + summary: Search for users by their username. + description: >- + Returns an array of objects representing the app users + whose usernames start with the search term. + Casing is ignored. + The user objects are stripped down to what is necessary + to know as an app user. + parameters: + - name: s + description: The term to search for. Must be at least two characters. + in: query + required: true + schema: + type: string + minLength: 2 + responses: + '200': + description: Success + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/userinfo' + '400': + description: Search term is invalid. + content: + application/json: + schema: + $ref: '#/components/schemas/input-error' + '401': + description: Authentication failure. + content: + text/plain: + schema: + type: string + '500': + description: The server cannot deliver due to an internal error. + content: + application/json: + schema: + $ref: '#/components/schemas/internal-error' + default: + description: Some unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/error' '/user': get: summary: Get the data of the user.