-
Notifications
You must be signed in to change notification settings - Fork 43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Empty sparse fieldset parameter returns 500 error #225
Comments
Thanks for reporting. This does indeed look like a bug, so I'll get this fixed. |
Out of interest, what do you expect the server to return when they've request no fields for the |
Actually, have found the answer in the spec:
So that would mean you only get the |
Ah that's interesting! Thanks for investigating 😄 |
Tagged in composer require laravel-json-api/laravel --no-update
composer up "laravel-json-api/*" |
Wow, that was fast - thank you so much! |
Aha yeah you caught me on an evening when I was doing Laravel JSON:API admin!! 😄 |
When providing an empty value to any of the
fields
query parameters, the server returns a 500 error with server error being:For example, if the client requests the following:
It certainly makes sense for an error to be returned, but I would have expected a validation error given that this is a client issue. It also ends up in our error tracking software which isn't great.
While not an ideal solution, I wondered if adding validation for each of the
fields
parameters (current resource and all relations) would help. Unfortunately, it still returns the same 500 error for the above request. For example:The text was updated successfully, but these errors were encountered: