woohoolabs / yang

The efficient and elegant, PSR-7 compliant JSON:API 1.1 client library for PHP
MIT License
168 stars 13 forks source link

Add ability to set more complex filter query parameter #30

Closed Insolita closed 3 years ago

Insolita commented 3 years ago

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