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

ODataJsonSerializer fails to write Collections of Complex Properties

    XMLWordPrintableJSON

Details

    Description

      Affected Method:
      org.apache.olingo.server.core.serializer.json.ODataJsonSerializer.writeComplexCollection(type, property, ...)

      The method writeComplexCollection iterates over the properties of a collection of properties and calls writeComplexValue(...).

      ODataJsonSerializer.java
      ...
      for (Object value : property.asCollection()) {
        switch (property.getValueType()) {
        case COLLECTION_LINKED_COMPLEX:
          writeComplexValue(type, ((LinkedComplexValue) value).getValue(), selectedPaths, json);
          break;
        case COLLECTION_COMPLEX:
          writeComplexValue(type, property.asComplex(), selectedPaths, json);
          break;
      ...
      

      The COLLECTION_COMPLEX case seems broken and should rather be something like:

      ODataJsonSerializer.java
      ...
        case COLLECTION_COMPLEX:
          writeComplexValue(type, ((Property) value).asComplex(), selectedPaths, json);
          break;
      ...
      

      Attachments

        1. fix_501.patch
          1 kB
          Michael Burwig

        Issue Links

          Activity

            People

              mirbo mibo
              Michael.Burwig Michael Burwig
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: