You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In an (encoded) URL like /my-model?filter%5Bname%5D=MY%2C+Search+Term which is filter[name]= "MY, Search Term" what Lux ends up with in the controller is:
This is caused by formatString in /src/packages/server/request/parser/utils/format.jswhich splits on , in all cases. @zacharygolba why is this so? What data type as a value in the query parameters should be split on comma (apart from a future ?sort=val1,val2,val3)?
EDIT: comma's are used for many of the JSONAPI specified qp's (sort, include, sparse fieldsets for as far as I can see). We might wan't to check if the key is one of those and only split on comma when that is the case? This should be safe as qp's aren't really nested.
Another option is to check the controller attribute types and explode except when the type is string (though this might be prone to errors and mistakes in i.e. custom qp's).
I'm also struggling with this - what is the correct way to escape the "," in a string to avoid this? AFAICT this isn't specified by the JSON API (http://jsonapi.org/format/#fetching-filtering). Edit: its used by Ember too by the looks of it when filtering by multiple ids.
In an (encoded) URL like
/my-model?filter%5Bname%5D=MY%2C+Search+Term
which isfilter[name]= "MY, Search Term"
what Lux ends up with in the controller is:Which is clearly wrong. The URL as shown above is encoded by ember-data from passing:
The text was updated successfully, but these errors were encountered: