http://pokeapi.azurewebsites.net/
An Api made in .NET core 3.x related to Pokemon. Get, add delete Pokémon.
A folder in the www root containing a certain amount of JSON files where each file represents a Pokémon. Each file is loaded into an SQL-Lite In-memory database at startup, to which the requests are made.
How to setup project on your own machine.
Dotnet core 3.1 https://dotnet.microsoft.com/download/dotnet-core/3.1
Visual Studio 2019: https://visualstudio.microsoft.com/downloads/ or other IDE/editor of choice.
Retrieve a list of pokemon.
Parameters are sent as query parameters.
Parameter | Value | Required | Example |
---|---|---|---|
Sort |
{propertyName} {direction} |
name desc | |
PageSize |
{number} |
10 | |
PageNumber |
{number} |
1 |
Retrieve a single pokemon.
Parameter | Value | Required | Example |
---|---|---|---|
Name |
{string} |
✅ | Bulbasaur |
Add a single pokemon.
Parameters are sent as JSON from body.
Parameter | Value | Required | Example |
---|---|---|---|
index |
{string} |
719 | |
name |
{string} |
✅ | Bulbasaur |
imageUrl |
{string} |
✅ | http://serebii.net/xy/pokemon/001.png |
types |
{array} |
"types": ["grass","poison"] | |
evolutions |
{array} of{object } |
▼ | |
moves |
{array} of{object } |
▼ |
"evolutions": [
{
"pokemon":2,
"event":"level-16"
}
],
"moves": [
{
"level": "37",
"name": "Seed Bomb",
"type": "grass",
"category": "physical",
"attack": "80",
"accuracy": "100",
"pp": "15",
"effect_percent": "--",
"description": "The user slams a barrage of hard-shelled seeds down on the target from above."
}
]
Delete a single pokemon.
Parameter | Value | Required | Example |
---|---|---|---|
Name |
{string} |
✅ | Bulbasaur |
Dotnet core 3.1 SDK and the runtime: https://dotnet.microsoft.com/download/dotnet-core/3.1
Visual Studio 2019: https://visualstudio.microsoft.com/downloads/
Use previews of the .NET Core SDK In Visual Studio 2019
- Tools
- Options
- Projects and Solutions
- .NET Core
- Check "Use previews of the .NET Core SDK"
- Update to Core 3.
- Use nullable reference types.
- Correctly load the collections of Pokemon with Entity Framework (Evolutions and Moves).
- Refractor.
- Add Pokémon endpoint
- Delete Pokémon endpoint
- Logging
- Custom exception handling (return generic api response)
- Add authorization/jwt tokens
- Add caching
- Validation failure should return generic api response
- Adding a Pokemon should return generic api response