Details
-
Bug
-
Status: Open
-
Major
-
Resolution: Unresolved
-
V2 2.0.10, V2 2.0.11
-
None
-
None
-
Any environment
Description
If you try to filter an entity set with the filter $filter=(), HTTP Status Code 500 and the error message
<?xml version='1.0' encoding='UTF-8'?>
<error xmlns="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata">
<code/>
<message xml:lang="en">while trying to invoke the method org.apache.olingo.odata2.api.uri.expression.CommonExpression.getKind() of a null object loaded from local variable 'leftNode'</message>
</error>
is returned.
Expected behaviour:
Either return HTTP Status Code 400 with an error message like "Invalid filter expression '()'" or return HTTP Status Code 200 with the unfiltered entity set.
How to reproduce:
Create the my-car-service sample:
mvn archetype:generate \
-DinteractiveMode=false \
-Dversion=1.0.0-SNAPSHOT \
-DgroupId=com.sample \
-DartifactId=my-car-service \
-DarchetypeGroupId=org.apache.olingo \
-DarchetypeArtifactId=olingo-odata2-sample-cars-annotation-archetype \
-DarchetypeVersion=RELEASE
Deploy the service and do a request using the URL
http://<hostname>:<port>/my-car-service/CarService.svc/Cars?$filter=()