PokeAPI / pokeapi

The Pokémon API
https://pokeapi.co
BSD 3-Clause "New" or "Revised" License
4.16k stars 936 forks source link

Order Moves / Evolutions by Level in Pokemon Resource #13

Closed phalt closed 8 years ago

phalt commented 9 years ago

Make sure the linked resources are ordered by level (where applicable). For example: Pokémon resources should have their Move resources ordered by level.

zaneadix commented 8 years ago

Heres an example of how moves are being ordered currently in v2. The way the new data works I don't know if moves can really be ordered by level. Maybe things could be re-ordered and collected by version_group rather than move? I ordered things this way mainly because listing moves "once" gives the user a lot less to iterate over.

[{
        "move": {
            "name": "synthesis",
            "url": "http://localhost:8000/api/v2/move/235/"
        },
        "version_group_details": [{
            "level_learned_at": 0,
            "version_group": {
                "name": "platinum",
                "url": "http://localhost:8000/api/v2/version-group/9/"
            },
            "move_learn_method": {
                "name": "tutor",
                "url": "http://localhost:8000/api/v2/move-learn-method/3/"
            }
        }, {
            "level_learned_at": 33,
            "version_group": {
                "name": "black-white",
                "url": "http://localhost:8000/api/v2/version-group/11/"
            },
            "move_learn_method": {
                "name": "level-up",
                "url": "http://localhost:8000/api/v2/move-learn-method/1/"
            }
        }, {
            "level_learned_at": 39,
            "version_group": {
                "name": "firered-leafgreen",
                "url": "http://localhost:8000/api/v2/version-group/7/"
            },
            "move_learn_method": {
                "name": "level-up",
                "url": "http://localhost:8000/api/v2/move-learn-method/1/"
            }
        }]
    }