Giter VIP home page Giter VIP logo

django-rest-backend's People

Contributors

sbmsr avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar

django-rest-backend's Issues

[Feature] Implement Get Pokemon by HP

What you need to do

Our API needs to support the ability to get all Pokemon, filtered by HP

Expected behavior

  1. a request to http://localhost:8000/pokemon/hp?gt=250 should return HTTP status 200 and the following JSON body
[
	{
		"id": 242,
		"name_english": "Blissey",
		"name_japanese": "ハピナス",
		"name_chinese": "幸福蛋",
		"name_french": "Leuphorie",
		"hp": 255,
		"attack": 10,
		"defense": 10,
		"special_attack": 75,
		"special_defense": 135,
		"speed": 55,
		"types": [
			{
				"type": "Normal"
			}
		]
	}
]
  1. a request to http://localhost:8000/pokemon/hp?gt=250&lt=20 should return HTTP status 404 and the following JSON body
{
    error: "Not found"
}
  1. a request to http://localhost:8000/pokemon/hp?badComparator=200 should return HTTP status 400 and the following JSON body
{ 
    error: 'Invalid Operator. Must be one of ["gt","gte","lt","lte"]' 
}

[Feature] Implement Get Pokemon by Name

4# What you need to do
Our API needs to support the ability to get a Pokemon by Name

Expected behavior

  1. a request to http://localhost:8000/pokemon/name/mew should return HTTP status 200 and the following JSON body
{
	"id": 151,
	"name_english": "Mew",
	"name_japanese": "ミュウ",
	"name_chinese": "梦幻",
	"name_french": "Mew",
	"hp": 100,
	"attack": 100,
	"defense": 100,
	"special_attack": 100,
	"special_defense": 100,
	"speed": 100,
	"types": [
		{
			"type": "Psychic"
		}
	]
}
  1. a request to http://localhost:8000/pokemon/name/jobsimulator should return HTTP status 404 and the following JSON body
{
    error: "Not found"
}

[Feature] Implement Get Pokemon by ID

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"
}

[Feature] Implement Get Pokemon by Type

What you need to do

Our API needs to support the ability to Get Pokemon by Type

Expected behavior

  1. a request to http://localhost:8000/pokemon/type/fairy should return HTTP status 200 and the following JSON body
[
	{
		"id": 35,
		"name_english": "Clefairy",
		"name_japanese": "ピッピ",
		"name_chinese": "皮皮",
		"name_french": "Mélofée",
		"hp": 70,
		"attack": 48,
		"defense": 45,
		"special_attack": 60,
		"special_defense": 65,
		"speed": 35,
		"types": [
			{
				"type": "Fairy"
			}
		]
	},
...
  1. a request to http://localhost:8000/pokemon/type/webdevwithseb should return HTTP status 400 and the following JSON body
{
    error: "Bad request"
}

[Feature] Update `/pokemon` endpoint to include a Pokémon's type

What you need to do

Our API needs to expose a Pokemon's type. As it currently stands, a request to http://localhost:8000/pokemon/ returns:

[
	{
		"id": 1,
		"name_english": "Bulbasaur",
		"name_japanese": "フシギダネ",
		"name_chinese": "妙蛙种子",
		"name_french": "Bulbizarre",
		"hp": 45,
		"attack": 49,
		"defense": 49,
		"special_attack": 65,
		"special_defense": 65,
		"speed": 45
	},
	{
		"id": 2,
...

Expected behavior

  1. a request to http://localhost:8000/pokemon/ should return HTTP status 200 and the following JSON body:
[
	{
		"id": 1,
		"name_english": "Bulbasaur",
		"name_japanese": "フシギダネ",
		"name_chinese": "妙蛙种子",
		"name_french": "Bulbizarre",
		"hp": 45,
		"attack": 49,
		"defense": 49,
		"special_attack": 65,
		"special_defense": 65,
		"speed": 45,
		"types": [
			{
				"type": "Grass"
			},
			{
				"type": "Poison"
			}
		]
	},
	{
		"id": 2,

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.