chicken-sloths / bangazon-api-sprint1

API for a mock Amazon + Etsy platform providing developers access to the company's employee & product data
0 stars 0 forks source link

what do we want to return on an empty search? #91

Closed kenziebottoms closed 6 years ago

kenziebottoms commented 6 years ago

If you search /customers and there are no customers, or go to /customers/3 and there is no customer with id 3, do we return an error object or just an empty array ([ ])?

DavidLarsKetch commented 6 years ago

That's a super good question. I lean towards sending back a 404: File Not Found error since the "file" at, say, /customers/3 isn't found. I don't have a strong opinion though. With using APIs in the past, what have you found to be standard when you make a request for a resource that isn't there?