developer-job-simulation / django-rest-backend

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Feature] Implement Get Pokemon by ID

sbmsr opened this issue · comments

commented

What you need to do

Our API needs to support the ability to get a Pokemon by ID.

Expected behavior

  1. a request to http://localhost:8000/pokemon/482/ should return HTTP status 200 and the following JSON body
{
	"id": 482,
	"name_english": "Azelf",
	"name_japanese": "アグノム",
	"name_chinese": "亚克诺姆",
	"name_french": "Créfadet",
	"hp": 75,
	"attack": 70,
	"defense": 125,
	"special_attack": 125,
	"special_defense": 70,
	"speed": 115,
	"types": [
		{
			"type": "Psychic"
		}
	]
}
  1. a request to http://localhost:8000/pokemon/999999999 should return HTTP status 404 and the following JSON body
{
    error: "Not found"
}