-
-
Notifications
You must be signed in to change notification settings - Fork 927
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
encounters return is different than other endpoints' #332
Comments
Hello, back in time the encounter endpoint wasn't there, but part of |
Interesting - that migration makes sense. I guess I was wondering if the following change makes sense at the last line of - return Response(encounters_list)
+ return Response({'results': encounters_list}) I haven't worked with Django before, or I might be able to suggest something more mature (with proper pagination). That sounds like the alignment you doubt will happen though. Let me know what you think. |
Yeah, probably is that simple fix 😄 So maybe you can open a PR and put me in the 'request review' and one day maybe it will be merged, but this change obviously could break lots of applications. So we have to be careful about deciding what to do. |
This makes it consistent with the every other resource Unfortunately this isn't tested or testable in the current framework, as distinct() is not supported by the sqlite3 backend
Closing this issue and marking it for a future v3 version. Right now we cannot change the endpoint format since it's used by many people. We acknowledge that your proposed solution would be the best option. |
Right now the encounters endpoint lives at
https://pokeapi.co/api/v2/pokemon/{id}/encounters
For a given id, the URL returns a list, rather than a hash. On the other hand, the endpoint URLs (eg.
/api/v2/pokemon
) return very similar data, but prefix that data withresults:
Would it make sense to do this here? Unfortunately, that's not a backwards-compatible change.I suggest this because I believe it would make it easier for API clients to handle the response - see eg.
PokeAPI/pokebase#10
The text was updated successfully, but these errors were encountered: