Closed tbrlpld closed 4 years ago
Thanks. Something must have changed because this was OK when I recorded it AFAIK. Appreciate the update.
Yea, I assume there was a responder update that changed how the routes are looked up. I did not confirm this, but I saw it working in the videos too 😄
On Jan 28, 2020, at 09:14, Michael Kennedy notifications@github.com wrote:
 Thanks. Something must have changed because this was OK when I recorded it AFAIK. Appreciate the update.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.
Before, the routes/views with parameters in the URL where defined first. E.g.
@api.route("/api/movie/genre/{genre}")
was defined before@api.route("/api/movie/genre/all")
.When trying to hit the URL for
/api/movie/genre/all
the response would be empty. This is because the this would not trigger the desired view, but the parameterized view would be passesgenre = all
. Since there are no movies with the genre "all" the response would be empty.To solve this issue, the ordering of the routes/views had to be adjusted. Now the most specific views are defined first, and then the more flexible views are defined.