[
https://issues.apache.org/jira/browse/OLINGO-825?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15131615#comment-15131615
]
Ramesh Reddy commented on OLINGO-825:
-------------------------------------
Yea, I agree about unit tests, they are little hard to follow and change. Do
you the patch file for your changes, that will give a me a head start on fixing
it.
> 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)