[
https://issues.apache.org/jira/browse/OLINGO-825?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Ramesh Reddy resolved OLINGO-825.
---------------------------------
Resolution: Fixed
Fix Version/s: (Java) V4 4.2.0
Fixed with
https://github.com/apache/olingo-odata4/commit/b7005b774f9172b00ee90773e2f32ed84a9597cd
Many thanks to [~frederik.zimmer] for identifying the providing the patch.
> 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
> Assignee: Ramesh Reddy
> Fix For: (Java) V4 4.2.0
>
> Attachments:
> OLINGO825-Create-entities-of-derived-types--ODataJso.patch
>
>
> 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)