Should a RESTful API return 404 for arrays of objects?

I would return an empty collection. A product with zero orders is a completely valid concept, so the existence of an empty orders collection makes more sense than a 404 which would infer that this product does not have a orders collection.

Leave a Comment