I’m building an ODATA compliant API using ASP.NET WebAPI?
Got a question about how it should behave when a $filter has no results?
Should it return an empty collection? or send HTTP 404 response?
Any ideas/reasoning? I’m biased towards returning an empty collection, but would it violate a recommended practice?
Given you are not directly addressing an individual resource at a specific known Request-Uri (e.g. /resource/{uid}) and your collection is also a known addressable Request-Uri (e.g. /resource) then a 404 would be inappropriate.
An empty collection is what I would expect if I was consuming your API.