[
https://issues.apache.org/jira/browse/OLINGO-501?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Michael Bolz updated OLINGO-501:
--------------------------------
Fix Version/s: (Java) V4 4.0.0-beta-02
> ODataJsonSerializer fails to write Collections of Complex Properties
> --------------------------------------------------------------------
>
> Key: OLINGO-501
> URL: https://issues.apache.org/jira/browse/OLINGO-501
> Project: Olingo
> Issue Type: Bug
> Components: odata4-server
> Affects Versions: V4 4.0.0-beta-01
> Reporter: Michael Burwig
> Assignee: Michael Bolz
> Priority: Critical
> Labels: easyfix
> Fix For: (Java) V4 4.0.0-beta-02
>
> Attachments: fix_501.patch
>
>
> 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(...).
> {code:title=ODataJsonSerializer.java|borderStyle=solid}
> ...
> 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;
> ...
> {code}
> The COLLECTION_COMPLEX case seems broken and should rather be something like:
> {code:title=ODataJsonSerializer.java|borderStyle=solid}
> ...
> case COLLECTION_COMPLEX:
> writeComplexValue(type, ((Property) value).asComplex(), selectedPaths,
> json);
> break;
> ...
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)