[ https://issues.apache.org/jira/browse/OLINGO-1221?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16341048#comment-16341048 ]
Frederik Zimmer commented on OLINGO-1221: ----------------------------------------- I have attached a patch that should fix the bug. > Expand on navigation property of derived type not working > --------------------------------------------------------- > > Key: OLINGO-1221 > URL: https://issues.apache.org/jira/browse/OLINGO-1221 > Project: Olingo > Issue Type: Bug > Components: odata4-server > Affects Versions: (Java) V4 4.4.0 > Reporter: Frederik Zimmer > Priority: Major > Attachments: > OLINGO1221-Expand-on-navigation-property-of-derived-.patch > > > I want to expand a navigation property that is defined in a derived type. So > something like this: > http://services.odata.org/TripPinRESTierService/People('ursulabright')/Friends?$expand=Microsoft.OData.Service.Sample.TrippinInMemory.Models.Manager/DirectReports > where Friends returns a Collections of Person which can be a Manager and only > a Manager has a navigation property DirectReports. > Olingo would return an error in this case that Person has no property > DirectReports. The reason is that the type cast is correctly parsed but it is > ignored. In the class ExpandParser Method parseExpandPath the navigation > property is looked up in type but it could be that a type cast in > item.getStartTypeFilter() is defined which contains the derived type that > should be used. > An additional question: > In my understanding the above URL should return all Friends of ursulabright > and for Friends who are of type Manager also the DirectReports should be > returned. Is this correct (the example odata service unfortunately has some > problem with this query)? -- This message was sent by Atlassian JIRA (v7.6.3#76005)