Skip to content

How do you construct complex filters like CONTAINS or IN? #985

Discussion options

You must be logged in to vote

The query in your example serializes to this:

params[filter][drupal_internal__nid][operator]=IN
&params[filter][drupal_internal__nid][value]=1
&params[filter][drupal_internal__nid][value]=2

which is not valid array syntax for most modern implementations.

Many deserializers will require the arrays to be suffixed with [] like this params[filter][drupal_internal_nid][value][]=1. This behaviour can be enabled in kitsu by providing the modern flag when creating your Kitsu instance https://github.com/wopian/kitsu/tree/master/packages/kitsu#parameters

The behaviour described above seems to be specifically discouraged in Drupal
https://www.drupal.org/docs/core-modules-and-themes/core-modules/jso…

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
1 reply
@gi-stuart
Comment options

Answer selected by gi-stuart
Comment options

You must be logged in to vote
1 reply
@gi-stuart
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants