jirutka / rsql-parser

Parser for RSQL / FIQL – query language for RESTful APIs
731 stars 156 forks source link

Empty Query #15

Closed nitinja closed 8 years ago

nitinja commented 8 years ago

Hi Everyone,

This is more of a question than an issue. Is there a way to send empty query to rsql endpoint in case I want to access all records at an endpoint?

I generally access my endpoint with rsql query as http://localhost:8080/api/things/rsql?query=name=="john"

Can I use same endpoint (with "rsql" at end) with empty query? One way to do it is reverting to the bare endpoint (http://localhost:8080/api/things) but this needs switching URL to bare one.

I tried query="" but it doesn't work.

vineey commented 8 years ago

@nitinjadhav466 in http terms, query parameter is a request parameter and by standard rule, it can be omitted which means it is empty. You can do this by just removing it entirely in the url such as

http://localhost:8080/api/things/rsq

Logically, this should allow you to query all records without any filtering. But of course,it depends on your backend implementation, such as on how you integrate rsql-parser into your application.

nitinja commented 8 years ago

Got it! Thanks.