Skip to content

Conversation

@Anupya
Copy link
Contributor

@Anupya Anupya commented Oct 22, 2023

Description

Implement get_otb_master_game = /master/pgn/{game_id}.

I did not add a return type for the function as there is no provided way to return ndjson/json in the response, but the response will be a PGN (text) due to the nature of the API endpoint.

After merge

Please check off /master/pgn/{game_id} in issue description of #6.

@benediktwerner
Copy link
Member

The correct return type should be str in that case, together with format=PGN in the call.

@Anupya
Copy link
Contributor Author

Anupya commented Oct 23, 2023

I don't think I need the format = PGN do I? since the response schema is application/x-chess-pgn.

@Anupya Anupya force-pushed the Anupya/add-otb-master-game-endpoint branch from e2910cd to f7d9d2b Compare October 30, 2023 18:43
@kraktus kraktus force-pushed the Anupya/add-otb-master-game-endpoint branch from f7d9d2b to 49254eb Compare November 1, 2023 07:41
@kraktus
Copy link
Member

kraktus commented Nov 1, 2023

Thanks! As benediktwerner said, formatting as PGN is necessary otherwise it throws an exception when being called. I've included a test to confirm and fix that. Generally when you're not sure best to test!

@kraktus kraktus merged commit dd0df4c into lichess-org:master Nov 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants