[
https://issues.apache.org/jira/browse/OLINGO-975?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Christian Amend resolved OLINGO-975.
------------------------------------
Resolution: Fixed
Assignee: Christian Amend
Fix Version/s: (Java) V4 4.4.0
Thanks for the contribution. I have applied the patch with the following
commit:
https://git-wip-us.apache.org/repos/asf?p=olingo-odata4.git;a=commit;h=173f0d78ad0b5388ee75d744e91e7694b9da9671
> Olingo client sends incorrect types for collection members
> ----------------------------------------------------------
>
> Key: OLINGO-975
> URL: https://issues.apache.org/jira/browse/OLINGO-975
> Project: Olingo
> Issue Type: Bug
> Components: odata4-client
> Affects Versions: (Java) V4 4.1.0
> Reporter: Torsten Küpper
> Assignee: Christian Amend
> Fix For: (Java) V4 4.4.0
>
> Attachments: OLINGO975.diff
>
>
> Hi,
> having derived class types in a collection, the Olingo Java client
> sends only the collection type. E.g. given that Employee and Customer both
> inherit from Person, and we have a collection RelatedPersons of Person, if
> the first collection member is an instance of Employee and the second a
> Customer, then the request contains
> "[email protected]": "#Collection(Person)",
> "RelatedPersons": [{
> "@odata.type": "Person", ...
> },
> {
> "@odata.type": "Person", ...
> }
> ]
> but correct would be
> "[email protected]": "#Collection(Person)",
> "RelatedPersons": [{
> "@odata.type": "Employee", ...
> },
> {
> "@odata.type": "Customer", ...
> }
> ]
> I found OLINGO-825 which seems to describe the issue just on the server
> side, which then received a fix.
> It seems to me the cause is that type gets lost in ODataBinderImpl when a
> translation of data to some internal representation which has no type
> information, at least for collection members, is done.
> In the reverse direction, when Olingo client receives a response, the type
> info is thrown away in JsonDeserializer in fromCollection
> if (child.has(Constants.JSON_TYPE)) {
> ((ObjectNode) child).remove(Constants.JSON_TYPE);
> }
> What could be done to fix this?
> Would a change be accepted which adds the type information to each
> collection member in the internal representation?
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)