API OData Query filter operators not working as expected
-
I am trying to get all root folders in JSReport server through the OData API. I am using this GET request:
- GET http://localhost:5488/odata/folders?$filter=folder/all(f:f/shortid eq 'xxxxxx')
to return all folders that do not contain a folder object. It seemed like this lambda expression did not work as it returned all folders in the JSReport unfiltered.
I then tried a simpler filter on my query:
- GET http://localhost:5488/odata/folders?$filter=name eq 'Some name'
and it worked. However, I tried using a not equals operator on the same query:
- GET http://localhost:5488/odata/folders?$filter=name ne 'Some name'
and the API just returned all the folders in the JSReport unfiltered.
Is it something I'm doing wrong with my queries and is this in issue with JSReport's API.
-
The odata support is unfortunately very limited in jsreport api. So the lambda expressions or
ne
won't work.However, you can use this to get the root folders
http://localhost:5488/odata/folders?$filter=folder eq null
-
From a reconnaissance point of view this is a very powerful command. Is there a way to disable this command in the API?
-
There is no configuration to disable this specific API call.
Personally, I don't see a reason. Maybe you could elaborate more on this.