Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Logical URL query-parameter language

Tags:

rest

I'm creating a REST API which can handle a dynamic set of filters (send as queryparams). In some cases the client wants to have a combination of filter applicable for a collection list. This could be nested and combined with AND/OR.

I wonder if there is any standard or opensource language definition for these statements which is specialised for use as URL query-parameters.

like image 677
Pepster Avatar asked Jul 22 '26 23:07

Pepster


1 Answers

Looking at Google I've decided to do it like this:

By default, multiple queryparams are logical ANDed together. Any bundled values are considered OR. e.g.

GET /users?filter=field1:value1,value2,value2&filter=fieldFoo=bar

like image 194
Pepster Avatar answered Jul 25 '26 18:07

Pepster