Skip to content

Commit

Permalink
Document endpoint /api/player/autocomplete (fix WandererXII#847)
Browse files Browse the repository at this point in the history
  • Loading branch information
ddugovic committed Jul 12, 2024
1 parent fea7739 commit 26bfd2e
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 1 deletion.
2 changes: 1 addition & 1 deletion conf/routes
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ GET /player controllers.User.list
GET /player/top/:nb/:perfKey controllers.User.topNb(nb: Int, perfKey: String)
GET /player/top/week controllers.User.topWeek
GET /player/online controllers.User.online
GET /player/autocomplete controllers.User.autocomplete
GET /api/player/autocomplete controllers.User.autocomplete

GET /dasher controllers.Dasher.get

Expand Down
54 changes: 54 additions & 0 deletions public/doc/lishogi-api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2364,6 +2364,60 @@ paths:
schema:
$ref: '#/components/schemas/Crosstable'

/api/player/autocomplete:
get:
operationId: apiPlayerAutocomplete
summary: Autocomplete usernames
description: |
Provides autocompletion options for an incomplete username.
tags:
- Users
security: []
parameters:
- in: query
name: term
description: The beginning of a username
schema:
type: string
minLength: 3
required: true
- in: query
name: object
description: |
- `false` returns an array of usernames
- `true` returns an object with matching users
schema:
type: boolean
default: false
- in: query
name: friend
description: |
Returns followed players matching `term` if any, else returns other players.
Requires [OAuth](#tag/OAuth).
schema:
type: boolean
responses:
"200":
description: An array of players which usernames start with the provided term.
headers:
Access-Control-Allow-Origin:
schema:
type: string
default: "'*'"
content:
application/json:
schema:
oneOf:
- type: array
items:
type: string
- type: object
properties:
result:
type: array
items:
$ref: '#/components/schemas/LightUser'

/api/stream/event:
get:
operationId: apiStreamEvent
Expand Down

0 comments on commit 26bfd2e

Please sign in to comment.