Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement the POST /api/opening endpoint #12

Closed
programarivm opened this issue Jan 12, 2022 · 0 comments · Fixed by #14 or #37
Closed

Implement the POST /api/opening endpoint #12

programarivm opened this issue Jan 12, 2022 · 0 comments · Fixed by #14 or #37
Labels
good first issue Good for newcomers help wanted Extra attention is needed

Comments

@programarivm
Copy link
Member

programarivm commented Jan 12, 2022

This endpoint is intended to fetch chess opening data given a set of parameters.

Method Endpoint Description
POST /api/opening Returns chess opening data.
Parameter Type Description Optional
eco string ECO code. Yes
name string Opening name. Yes
movetext string Movetext. Yes
Response Description
200 (OK) The chess opening is valid.
204 (No Content) The chess opening was found in the database.

Query examples:

curl -d '{"eco":"B94"}' -H "Content-Type: application/json" -X POST http://localhost:8000/api/opening

Response:

{
  "eco": "B94",
  "name": "Sicilian Defense: Najdorf Variation",
  "movetext": "1.e4 c5 2.Nf3 d6 3.d4 cxd4 4.Nxd4 Nf6 5.Nc3 a6 6.Bg5"
}

The POST /api/opening endpoint should be implemented in a new file called src/Controller/OpeningController.php.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
1 participant