Closed d-m- closed 6 years ago
Although, I am in agreement with this PR, I feel like this will need to be pushed in such a way to inform users that it breaks the current flow. This push could break several websites.
Yes it might break existing sites - but it certainly does break sites that are expecting a standards conforming reply according to http://jsonapi.org/format/#fetching-resources-responses
You're basically "punishing" clients that conform while being lenient to clients that do not conform.
As for a my opinion what it should do:
I'm not sure what is the best one:
I feel we can keep it V3, but I'm open for ideas/suggestions.
I'm leaning towards a minor version upgrade.
As @GawainLynch said on Slack:
Given that you're fixing a bug, a BC break like that in a minor is permitted
@jadwigo and @xiaohutai - That works for me then. Merge away!
Thanks @d-m- for the PR!
If the response to a request is an empty list, return that empty list with status 200, instead of 400. Fixes issue #70.
Removed method throwErrorOnNoResults, as it would be used only in SingleAction.php (for retrieving a single record). Changed the status code from 400 to 404 for the response if this record does not exist, according to http://jsonapi.org/format/#fetching-resources-responses.