Skip to content

Fix tactics API: migrate to v2 endpoint - #5

Open
felprangel wants to merge 1 commit into
marcusbuffett:masterfrom
felprangel:fix/tactics-v2-api
Open

Fix tactics API: migrate to v2 endpoint#5
felprangel wants to merge 1 commit into
marcusbuffett:masterfrom
felprangel:fix/tactics-v2-api

Conversation

@felprangel

Copy link
Copy Markdown

Summary

  • chessmadra.com moved the tactics endpoint from /api/v1/tactic (now 404) to /api/v2/tactic, which is why the CLI stopped getting any response.
  • The v2 response also wraps the tactic in a {"tactic": ..., "count": N} envelope with camelCase fields (gameLink, ratingDeviation, numberPlays) instead of the old flat snake_case body — updated parsing to match.
  • Switched reqwest to the rustls-tls backend instead of the default native-tls, since native-tls pulls in openssl-sys, which fails to build against newer OpenSSL/gcc toolchains (e.g. current Arch Linux).

Test plan

  • cargo build succeeds
  • Ran the built binary end-to-end (no flags): fetches a tactic from the live API, renders the board, evaluates moves, plays out opponent replies, and completes the puzzle
  • Verified /api/v1/tactic returns 404 and /api/v2/tactic returns a valid tactic via curl against the live server

chessmadra.com moved the tactics endpoint from /api/v1/tactic (now 404)
to /api/v2/tactic, which also wraps the tactic in a {"tactic": ...}
envelope with camelCase fields instead of a flat snake_case body. Update
the endpoint and response parsing accordingly.

Also switch reqwest to rustls-tls instead of the default native-tls
backend, since native-tls pulls in openssl-sys, which fails to build
against newer OpenSSL/gcc toolchains.
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.

1 participant