Uploaded image for project: 'Olingo'
  1. Olingo
  2. OLINGO-744

Bug in Function Imports: nullable parameters not supported

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • V2 2.0.4
    • V2 2.0.5
    • odata2-jpa
    • 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.

      Attachments

        Activity

          People

            chandan.v.a Chandan V.A
            Andreas Pfenninger Andreas Pfenninger
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: