trebol-ecommerce / api

eCommerce web service REST specification
GNU General Public License v3.0
0 stars 0 forks source link

Deprecate parameterized API paths #27

Closed bglamadrid closed 2 years ago

bglamadrid commented 2 years ago

Single-entity resources such as PUT /data/sales/1 or GET /data/products/BARCODE1 give the API too many unnecessary boilerplate interfaces. A good alternative are query parameters, which allow both types of resources (single-entity and multi-entity) to coexist and work under the same path. With query parameters, one can call PUT /data/sales?id=1 instead of PUT /data/sales/1 and GET /data/users?roleCode=customer?pageSize=1 to perform all desired operations.

Originally posted by @bglamadrid in https://github.com/trebol-ecommerce/trebol-api/issues/16#issuecomment-910729136