pokeapi icon indicating copy to clipboard operation
pokeapi copied to clipboard

super-contest-effect skips id

Open zberk opened this issue 10 years ago • 2 comments

Hey there, thanks for this amazing resource!

I was making your recommendation and persisting the dataset to a personal database when I hit a snag. For super-contest-effects, I was looping over the results and would get a 404 on id 3. Sure enough, id 3 doesn't exist! I've handled this in my code, but I am unsure of how it can be fixed on your end. I will update this issue with any other skipped values that I may come across. Thanks guys/gals!

zberk avatar May 12 '16 12:05 zberk

Ah interesting. Why would you expect ID 3 to exist? The ID is just an identifier, it doesn't necessarily have to numerically increment 😆 We could have opted to use UUIDs but instead we picked single numbers. The best way to get around this is to call the endpoints without an ID to get back paginated results. For example:

http://pokeapi/api/v2/pokemon

and use the hypermedia links to paginated through and get links to each resource :)

phalt avatar May 12 '16 13:05 phalt

Ah, I see. I will update my solution to work along those lines, thanks!

zberk avatar May 13 '16 03:05 zberk