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

Olingo V4 client does not parse expression annotations correctly

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • None
    • (Java) V4 5.0.1
    • odata4-client
    • None

    Description

      Olingo V4 client does not parse expression annotations correctly.

      Annotations on logical & comparison expressions and UrlRf expressions are not parsed at all. The corresponding deserializers do not honor "Annotation" elements.

      Annotations on the following expressions get wrapped into another CsdlAnnotation instance due to missing 'jp.nextToken()' calls in the corresponding deserializers:

      • ClientCsdlNull
      • ClientCsdlApply
      • ClientCsdlCast
      • ClientCsdlIsOf
      • ClientCsdlLabeledElement

      Only annotations on Record expressions are parsed as expected. This is explained by 'jp.nextToken()' call in ClientCsdlRecord, which is missing in other deserializers:

      ...
      else if ("Annotation".equals(jp.getCurrentName())) {
          jp.nextToken();
          record.getAnnotations().add(jp.readValueAs(ClientCsdlAnnotation.class));
      }
      ...
      

      I created a unit test to reproduce the issue.
      Steps to reproduce:
      1. git clone https://github.com/vladglinskiy/olingo-odata4.git
      2. git checkout csdl-deserializer-bugs
      3. mvn clean test -pl lib/client-core/ -Dtest=AnnotatedExpressionTest

      All tests except annotatedRecordExpressionTest will fail.

      Attachments

        Activity

          People

            Unassigned Unassigned
            vladglinskiy Vladislav Glinskiy
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: