-
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
WhereIdIn filter doesn't work #68
Comments
You should validate the |
This:
Is a string, so you should validate the
When it's a string (and assuming your delimiter is If you intend to use an array, the format of the
And for multiple:
|
Thanks for info. I thought it might be some problem with validation, but I wasn't able to find any information in docs (here: https://laraveljsonapi.io/docs/1.0/schemas/filters.html). There is not a single word about validationg query params on this particular docs subpage. Also here https://laraveljsonapi.io/docs/1.0/schemas/filters.html#whereidin is wrong example. This is a copy-paste from the docs:
As you can see, you are not passing the ID as an array. |
Ah right yeah so that's a typo in the docs. There's a whole chapter on query parameter validation here: But you're right that maybe the two chapters aren't cross-referenced enough. I'll reopen this issue to remind me to fix the docs. |
I've:
|
Version: v1.0.0-beta.1
Im getting this error "Expecting filter value to be an array, or a string when a string delimiter is set.".
URL Im hitting: http://localhost:8000/api/jsonapi/product-categories?filter[id]=3
My
filters
method inSchema
class:I think the problem is here: /vendor/laravel-json-api/eloquent/src/Filters/Concerns/HasDelimiter.php on line 53:
This method throws that error, because the
$value
is simply a string.I think this is a bug.
The text was updated successfully, but these errors were encountered: