woohoolabs / yang

The efficient and elegant, PSR-7 compliant JSON:API 1.1 client library for PHP

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add ability to set more complex filter query parameter

Insolita opened this issue · comments

Accordingly JsonApi specification

JSON:API is agnostic about the strategies supported by a server. The filter query parameter can be used as the basis for any number of filtering strategies.

Current JsonApiRequestBuilder realization restrict filter strategy https://github.com/woohoolabs/yang/blob/master/src/JsonApi/Request/JsonApiRequestBuilder.php#L258

The filter params can be represented only like filter[field1]=value&filter[field2]=val1,val2

But my strategy requires a more flexible form like filter[field1][like]=foo&filter[field2][lt]=100&filter[field2][gt]=5 (or even with more condition depth)

Right now is not possible even to override this method, because queryString property is private

If you are interested in solving this problem, we can discuss ways to fix it and I can create a PR