Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
V2 2.0.4
-
None
Description
The OLingo framework seems not to allow optional parameters, e.g. for the following function:
<FunctionImport Name="Function" ReturnType="Collection(PU.Foo)" EntitySet="Foos" m:HttpMethod="GET"> <Parameter Name="param1" Type="Edm.String" Nullable="true" <Parameter Name="param2" Type="Edm.Int64" </FunctionImport>
Annotation:
@EdmFunctionImportParameter(name = "param1", facets = @EdmFacets(nullable = true))
Even though parameter "param1" has the attribute Nullable="true", OLingo throws a NullPointerException if that parameter is not passed in the query:
test.svc/Function?param2=3
The desired behavior is a function with optional query parameter "param1".
Root cause is a bug in JPAFunctionContext.java:
- line 97: arguments array in method "getAruguments" initialized with wrong size
- line 119: Missing null check in method "convertArguement"
It would be very much appreciated if you could fix the bug in a future release.