You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@olingo.apache.org by "Christian Amend (JIRA)" <ji...@apache.org> on 2015/11/17 14:14:11 UTC

[jira] [Commented] (OLINGO-825) Create entities of derived types - ODataJsonDeserializer ignoring odata.type

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

Christian Amend commented on OLINGO-825:
----------------------------------------

Hi Frederik,

mixed collections of any kind are not yet supported. This is why we currently ignore the type annotations. I have changed this JIRA item to feature request instead of bug. If you would like to contribute let us know.

Best Regards,
Christian

> Create entities of derived types - ODataJsonDeserializer ignoring odata.type
> ----------------------------------------------------------------------------
>
>                 Key: OLINGO-825
>                 URL: https://issues.apache.org/jira/browse/OLINGO-825
>             Project: Olingo
>          Issue Type: New Feature
>          Components: odata4-server
>    Affects Versions: (Java) V4 4.0.0
>            Reporter: Frederik Zimmer
>
> I have an entity which is linked to a collection of entities of a base type. Something like this:
> <EntityType Name="MyBaseType" Abstract="true">
> [...]
> </EntityType>
> <EntityType Name="DerviedTypeA" BaseType=" MyBaseType ">
> [...]
> </EntityType>
> <EntityType Name="DerviedTypeB" BaseType="MyBaseType ">
> [...]
> </EntityType>
> <EntityType Name="A">
> [...]
> <NavigationProperty Name="params" Type="Collection(MyBaseType)"/> </EntityType>
> A deep insert of the entity A and the entity set params is done. The entity set contains entities of type DerviedTypeA and DerviedTypeB. The request contains odata.type annotations which specify the correct type of the entities. The ODataJsonDeserializer ignores the odata.type annotations and then tries to create DerviedTypeA and DerviedTypeB entities as entities of type MyBaseType and therefore complains that there are more properties than expected.
> The spec says that the odata.type annotation must be present if "The type is derived from the type specified for the (collection of) entities or (collection of) complex type instances" as there is no other way to know the correct type.
> The ODataJsonDeserializer should not ignore the odata.type annotations.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)