Skip to content

AdditionalData map not populated for collections #295

@kitherill

Description

@kitherill

DefaultSerializer.setChildAdditionalData() lacks support of collections. As you can see, only a HashMap (why not just Map???) and IJsonBackedObject are supported. As a result all other collections fail to get additionalDataManager field populated. For instance, DriveItems fetched with GET /user/{userId}/drive/root/delta don't have this field populated for createdBy.user object. Same object's property is populated for Drive as response's value field is scalar.

Expected behavior

DriveItem.createdBy.user.additionalDataManager should contain user email

Actual behavior

DriveItem.createdBy.user.additionalDataManager is empty

Steps to reproduce the behavior

        final String json = "{\n"
                + "    \"@odata.context\": \"https://graph.microsoft.com/v1.0/$metadata#users('02008492-3fec-4ce4-bb54-980ad856856f')/drive/root/children\",\n"
                + "    \"value\": [\n"
                + "        {\n"
                + "            \"createdBy\": {\n"
                + "                \"user\": {\n"
                + "                    \"email\": \"the@email.com\",\n"
                + "                    \"id\": \"02008492-3fec-4ce4-bb54-980ad856856f\",\n"
                + "                    \"displayName\": \"John Doe\"\n"
                + "                }\n"
                + "            }\n"
                + "        }\n"
                + "    ]\n"
                + "}";
        
        final DefaultSerializer serializer = new DefaultSerializer(new DefaultLogger());
        final DriveItemDeltaCollectionResponse deserialized = serializer
                .deserializeObject(json, DriveItemDeltaCollectionResponse.class);

        System.out.println(deserialized.value.get(0).createdBy.user.additionalDataManager());```

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions