API Endpoint Design : Technical Spec or Product
We have 2 developers who have conflicts in the way to design the RESTful
API Endpoint. Basically, let say that we have Facebook product in hand,
one table for the posts.
First developer give the opinions that
We should seperate Endpoint by product, not by the technical storage. To
be like that, we will have endpoint for user facebook post and other
facebook post.
/v1/wall/mypost
/v1/wall/other
To be like that, we be able to configure each products that may return
difference results
Second developer disagree, give the opinions that
If be like that, it will make infinite endpoint. it will have
/wall/someone, /wall/sometwo.
We should have single endpoint, and just let that be a part of query. ex.
/wall?user=someone, /wall?user=sometwo
The endpoint should be look like technical schema, it return the same
result, why it have to seperated to make it more jobs on maintenance the
code.
What is the good practice to design our endpoint? Is it should be endpoint
by the product? or is it should be by schema?
No comments:
Post a Comment