DoDCIO / eads

Enterprise APIs for Data Sharing (EADS)
https://dodcio.github.io/eads
Other
7 stars 2 forks source link

Resource Naming Anti-Patterns #87

Open ostranme opened 7 years ago

ostranme commented 7 years ago

Should EADS include a small section about resource naming anti-patterns? Sometimes it's informative to see bad examples of anti-patterns in the "wild". Maybe include examples of poor RESTful URIs and what NOT to do.

Possible Examples

  1. Using query-string parameters to specify the requested operation and/or HTTP verb. GET http://api.example.com/services?op=update_artist&id=12345&format=json

  2. Using a route name for a specific operation. GET http://api.example.com/update_artist/12345 GET http://api.example.com/artists/12345/update

  3. Redundancy (both HTTP verb and path). PUT http://api.example.com/artists/12345/update

killerbgt commented 7 years ago

Thanks for the feedback. We'll consider adding good/bad examples to the URL Naming section.