-
-
Notifications
You must be signed in to change notification settings - Fork 152
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
document /api/puzzle/next - closes lichess-org/lila#16465
- Loading branch information
Showing
2 changed files
with
49 additions
and
0 deletions.
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
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,46 @@ | ||
get: | ||
operationId: apiPuzzleNext | ||
summary: Get a new puzzle | ||
description: | | ||
Get a random Lichess puzzle in JSON format. | ||
If authenticated, only returns puzzles that the user has never seen before. | ||
**DO NOT** use this endpoint to enumerate puzzles for mass download. Instead, download the [full public puzzle database](https://database.lichess.org/#puzzles). | ||
tags: | ||
- Puzzles | ||
security: | ||
- OAuth2: ["puzzle:read"] | ||
parameters: | ||
- in: path | ||
Check failure on line 15 in doc/specs/tags/puzzles/api-puzzle-next.yaml GitHub Actions / Lint OpenAPI spec
Check failure on line 15 in doc/specs/tags/puzzles/api-puzzle-next.yaml GitHub Actions / Lint OpenAPI spec
|
||
name: angle | ||
required: false | ||
description: | | ||
The theme or opening to filter puzzles with. | ||
Available themes are listed in [the lichess source code](https://github.com/lichess-org/lila/blob/master/modules/puzzle/src/main/PuzzleTheme.scala). | ||
schema: | ||
type: string | ||
- in: path | ||
Check failure on line 24 in doc/specs/tags/puzzles/api-puzzle-next.yaml GitHub Actions / Lint OpenAPI spec
Check failure on line 24 in doc/specs/tags/puzzles/api-puzzle-next.yaml GitHub Actions / Lint OpenAPI spec
|
||
name: difficulty | ||
required: false | ||
description: The desired puzzle difficulty, relative to the authenticated user puzzle rating, or 1500 if anonymous. | ||
schema: | ||
enum: | ||
- easiest | ||
- easier | ||
- normal | ||
- harder | ||
- hardest | ||
responses: | ||
"200": | ||
description: The requested puzzle. | ||
headers: | ||
Access-Control-Allow-Origin: | ||
schema: | ||
type: string | ||
default: "'*'" | ||
content: | ||
application/json: | ||
schema: | ||
$ref: "../../schemas/PuzzleAndGame.yaml" |