[
https://issues.apache.org/jira/browse/OLINGO-964?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Christian Amend resolved OLINGO-964.
------------------------------------
Resolution: Fixed
Assignee: Christian Amend
Fix Version/s: (Java) V4 4.3.0
Hi [~jabomi],
although there is no test for this I have decided to apply your patch and write
a test on my own. This test can serve as an example if you would like to
contribute further code which I hope. So thank you for your first patch.
Also if I understand correctly you would like to cast a navigation property to
multiple different sub types. This is not supported by the specification. You
can have one cast to your final type. One exception is if you would like to
cast a collection before applying the keys and then casting again after they
have been applied. This is possible. Here is a sample:
EnititySet/namespace.SubType(key)/namespace.SubTypeofSubType
Please close the issue if you see no further need for changes.
Here the commit with your changes:
https://git-wip-us.apache.org/repos/asf?p=olingo-odata4.git;a=commit;h=8a10f47b8955f7c4b60b8f3bdcdc8fbf5240199d
Here the sample test case:
https://git-wip-us.apache.org/repos/asf?p=olingo-odata4.git;a=commit;h=bde34e597fee96e8288f496556bb272a572a13fd
Best Regards,
Christian
> Cast type (typeFilterOnCollection) not taken into account while expanding a
> collection
> --------------------------------------------------------------------------------------
>
> Key: OLINGO-964
> URL: https://issues.apache.org/jira/browse/OLINGO-964
> Project: Olingo
> Issue Type: Bug
> Components: odata4-server
> Affects Versions: (Java) V4 4.2.0
> Reporter: Jacek MiĆaczewski
> Assignee: Christian Amend
> Priority: Critical
> Fix For: (Java) V4 4.3.0
>
> Attachments:
> 0001-fix-proposal-for-cast-type-not-taken-into-account-wh.patch
>
>
> When user want to expand collection of entities (e.g. 'Products') with
> casting type of this collection to some subtype (''FeaturedProduct) and use
> property from this subtype as navigation property to be expanded
> ('Advertisement'), error occurs because of not taking into account this
> subtype in ExpandParser.java code but use only superType instead.
> Example url:
> http://.../OData.svc/Categories(1)?$expand=Products/ODataDemo.FeaturedProduct($expand=Advertisement)
> I attach a patch with proposal fix to illustrate what is going on and how it
> should work in my opinion.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)