From 49cf2402db971ce301f507a261542de3a77b4d59 Mon Sep 17 00:00:00 2001 From: Trevor Fitzgerald Date: Sun, 17 Nov 2024 11:12:53 -0500 Subject: [PATCH 1/2] Add schema for cloud eval response --- doc/specs/schemas/CloudEval.yaml | 44 +++++++++++++++++++ doc/specs/schemas/_index.yaml | 3 ++ doc/specs/tags/analysis/api-cloud-eval.yaml | 14 ++---- .../tags/studies/api-study-studyId.pgn.yaml | 2 +- 4 files changed, 51 insertions(+), 12 deletions(-) create mode 100644 doc/specs/schemas/CloudEval.yaml diff --git a/doc/specs/schemas/CloudEval.yaml b/doc/specs/schemas/CloudEval.yaml new file mode 100644 index 0000000..90f2958 --- /dev/null +++ b/doc/specs/schemas/CloudEval.yaml @@ -0,0 +1,44 @@ +type: object + +properties: + depth: + type: integer + fen: + type: string + knodes: + type: integer + pvs: + type: array + items: + type: object + properties: + cp: + type: integer + description: Evaluation in centi-pawns, from White's point of view + mate: + type: integer + description: Evaluation in moves to mate, from White's point of view + moves: + type: string + description: Variation in UCI notation + +example: + { + "depth": 29, + "fen": "r1bqkbnr/pppp1ppp/2n5/1B2p3/4P3/5N2/PPPP1PPP/RNBQK2R", + "knodes": 106325, + "pvs": [ + { + "cp": 41, + "moves": "d1e2 d8e7 a2a4 a7a6 b5c4 d7d6 d2d3 g8f6 c1e3 c6a5" + }, + { + "cp": 39, + "moves": "c2c3 a7a6 b5a4 g8f6 d2d3 b7b5 a4b3 h7h6 a2a4 c8b7" + }, + { + "cp": 37, + "moves": "d2d3 d8f6 c2c3 a7a6 b5a4 f8c5 d3d4 c5a7 c1e3 g8e7" + } + ] + } diff --git a/doc/specs/schemas/_index.yaml b/doc/specs/schemas/_index.yaml index 3c64f44..abe02f6 100644 --- a/doc/specs/schemas/_index.yaml +++ b/doc/specs/schemas/_index.yaml @@ -34,6 +34,9 @@ ChallengeCanceledJson: ChallengeOpenJson: $ref: './ChallengeOpenJson.yaml' +CloudEval: + $ref: './CloudEval.yaml' + BulkPairing: $ref: './BulkPairing.yaml' diff --git a/doc/specs/tags/analysis/api-cloud-eval.yaml b/doc/specs/tags/analysis/api-cloud-eval.yaml index 4c8f91b..c651878 100644 --- a/doc/specs/tags/analysis/api-cloud-eval.yaml +++ b/doc/specs/tags/analysis/api-cloud-eval.yaml @@ -17,7 +17,7 @@ get: description: FEN of the position schema: type: string - example: rnbqkbnr/ppp1pppp/8/3pP3/8/8/PPPP1PPP/RNBQKBNR b KQkq - 0 2 + example: r1bqkbnr/pppp1ppp/2n5/1B2p3/4P3/5N2/PPPP1PPP/RNBQK2R b KQkq - 3 3 - in: query name: multiPv description: Number of variations @@ -39,16 +39,8 @@ get: default: "'*'" content: application/json: - example: { - "fen": "rnbqkbnr/ppp1pppp/8/3pP3/8/8/PPPP1PPP/RNBQKBNR b KQkq - 0 2", - "knodes": 13683, - "depth": 22, - "pvs": [ - {"moves": "c8f5 d2d4 e7e6 g1f3 g8e7 c1e3 c7c5 d4c5 e7c6 b1c3", "cp": -13}, - {"moves": "c7c5 c2c3 d5d4 g1f3 b8c6 c3d4 c6d4 b1c3 c8d7 f1d3", "cp": -1}, - {"moves": "e7e6 d2d4 c7c5 c2c3 b8c6 g1f3 c8d7 b1a3 c5d4 c3d4", "cp": 24} - ] - } + schema: + $ref: '#/components/schemas/CloudEval' "404": description: The position was not found in the cloud evaluation database. content: diff --git a/doc/specs/tags/studies/api-study-studyId.pgn.yaml b/doc/specs/tags/studies/api-study-studyId.pgn.yaml index 05b1608..81427f0 100644 --- a/doc/specs/tags/studies/api-study-studyId.pgn.yaml +++ b/doc/specs/tags/studies/api-study-studyId.pgn.yaml @@ -85,7 +85,7 @@ head: schema: type: string responses: - "200": + 204: description: The study headers. headers: Access-Control-Allow-Origin: From 50f950b5507f1c48e2441815f18a72403aab2799 Mon Sep 17 00:00:00 2001 From: Trevor Fitzgerald Date: Sun, 17 Nov 2024 11:24:18 -0500 Subject: [PATCH 2/2] fix spectral --- doc/specs/schemas/_index.yaml | 3 --- doc/specs/tags/analysis/api-cloud-eval.yaml | 2 +- doc/specs/tags/studies/api-study-studyId.pgn.yaml | 2 +- 3 files changed, 2 insertions(+), 5 deletions(-) diff --git a/doc/specs/schemas/_index.yaml b/doc/specs/schemas/_index.yaml index abe02f6..3c64f44 100644 --- a/doc/specs/schemas/_index.yaml +++ b/doc/specs/schemas/_index.yaml @@ -34,9 +34,6 @@ ChallengeCanceledJson: ChallengeOpenJson: $ref: './ChallengeOpenJson.yaml' -CloudEval: - $ref: './CloudEval.yaml' - BulkPairing: $ref: './BulkPairing.yaml' diff --git a/doc/specs/tags/analysis/api-cloud-eval.yaml b/doc/specs/tags/analysis/api-cloud-eval.yaml index c651878..0ed963c 100644 --- a/doc/specs/tags/analysis/api-cloud-eval.yaml +++ b/doc/specs/tags/analysis/api-cloud-eval.yaml @@ -40,7 +40,7 @@ get: content: application/json: schema: - $ref: '#/components/schemas/CloudEval' + $ref: "../../schemas/CloudEval.yaml" "404": description: The position was not found in the cloud evaluation database. content: diff --git a/doc/specs/tags/studies/api-study-studyId.pgn.yaml b/doc/specs/tags/studies/api-study-studyId.pgn.yaml index 81427f0..1077dff 100644 --- a/doc/specs/tags/studies/api-study-studyId.pgn.yaml +++ b/doc/specs/tags/studies/api-study-studyId.pgn.yaml @@ -85,7 +85,7 @@ head: schema: type: string responses: - 204: + "204": description: The study headers. headers: Access-Control-Allow-Origin: