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

Serializer for complex collection properties does not respect $select

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • (Java) V4 4.4.0
    • None
    • odata4-server

    Description

      I have an entity type that contains a complex collection property:

       

      <EntityType Name="Person">
        <Property Name="BirthDay" Type="Edm.Date"/>
        <Property Name="LastName" Type="Edm.String" MaxLength="255"/>
        <Property Name="FirstName" Type="Edm.String" MaxLength="255"/>
        <Property Name="InhouseAddress" Type="Collection(dummy.InhouseAddress)">
      

       

      Now I can try to restrict the returned columns using $select:

       

      .../Persons('99')/InhouseAddress?$select=Building,TaskID

      The serializer (JSON as well as XML) do not respect the $select and fills all not retrieved properties with null: 

      <m:value m:type="#Collection(dummy.InhouseAddress)" m:context="$metadata#Persons/InhouseAddress">
      <m:element>
         <d:RoomNumber m:null="true"/>
         <d:Floor m:null="true"/>
         <d:TaskID>DEV</d:TaskID>
         <d:Building>1</d:Building>
      </m:element>
      </m:value>
      

       
      It looks like this is because ODataXmlSerializer.complexCollection sets the parameter selectedPaths to null when calling writeComplexValue

       

      Attachments

        Activity

          People

            Unassigned Unassigned
            grande Oliver Grande
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: