You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the current API spec the routes /api/articles/feed and /api/articles/:slug are ambiguous, in the sense that they use the same path structure. This is a problem for two reasons.
First of all, it makes certain API routes unusable (such as the excellent https://github.com/julienschmidt/httprouter for Go), because the internal trie structure does not lend itself to making this distinction very well.
But perhaps more importantly, it breaks the user experience in a weird way. If you try to view an article with the title Feed, it will have a slug feed and try to look up /api/articles/feed and break, because that returns a list of articles instead of a single article. Overall it becomes an edge case that you have to handle everywhere, in both tools and business logic.
Might I suggest /api/feed instead? It's unambiguous and equally clear!
The text was updated successfully, but these errors were encountered:
In the current API spec the routes
/api/articles/feed
and/api/articles/:slug
are ambiguous, in the sense that they use the same path structure. This is a problem for two reasons.First of all, it makes certain API routes unusable (such as the excellent https://github.com/julienschmidt/httprouter for Go), because the internal trie structure does not lend itself to making this distinction very well.
But perhaps more importantly, it breaks the user experience in a weird way. If you try to view an article with the title
Feed
, it will have a slugfeed
and try to look up/api/articles/feed
and break, because that returns a list of articles instead of a single article. Overall it becomes an edge case that you have to handle everywhere, in both tools and business logic.Might I suggest
/api/feed
instead? It's unambiguous and equally clear!The text was updated successfully, but these errors were encountered: