[ 
https://issues.apache.org/jira/browse/OLINGO-1395?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16926553#comment-16926553
 ] 

Daniel Fernández commented on OLINGO-1395:
------------------------------------------

Created pull request with a fix for this: 
https://github.com/apache/olingo-odata4/pull/55

> EDM parsing error when ReturnType element contains Annotation
> -------------------------------------------------------------
>
>                 Key: OLINGO-1395
>                 URL: https://issues.apache.org/jira/browse/OLINGO-1395
>             Project: Olingo
>          Issue Type: Bug
>          Components: odata4-client
>    Affects Versions: (Java) V4 4.6.0
>            Reporter: Daniel Fernández
>            Priority: Major
>              Labels: metadata, odata4, parsing
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> *Description*
> The current EDM parsing infrastructure does not take into account the 
> possibility that a {{<ReturnType>}} element contains an {{<Annotation>}}.
> This causes that a structure such as this (from a Cognos TM1 service):
> {code:xml}
> <ReturnType Type="tm1.Hierarchy" Nullable="false">
>       <Annotation Term="Core.Description">
>               <String>The newly created all leaves hierarchy.</String>
>       </Annotation>
> </ReturnType>
> {code}
> ...ends up messing the close tags, and closing the element containing the 
> {{<ReturnType>}} before it should, causing the rest of the EDM to be ignored 
> and the service being inaccessible.
> *Cause*
> The cause seems to be that the parsing code in the 
> {{org.apache.olingo.client.core.edm.xml.ClientCsdlReturnType}} class does not 
> include {{Annotation}} among the possible elements contained inside a 
> {{ReturnType}}.
> As can be seen in the spec at 
> https://docs.oasis-open.org/odata/odata-csdl-xml/v4.01/csprd05/odata-csdl-xml-v4.01-csprd05.html#sec_ReturnType,
>  the {{edm:ReturnType}} element may contain {{edm:Annotation}} elements.



--
This message was sent by Atlassian Jira
(v8.3.2#803003)

Reply via email to