Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 54745200CCA for ; Wed, 5 Jul 2017 07:51:04 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 53B1F162681; Wed, 5 Jul 2017 05:51:04 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 3DBC216267F for ; Wed, 5 Jul 2017 07:51:03 +0200 (CEST) Received: (qmail 94845 invoked by uid 500); 5 Jul 2017 05:51:02 -0000 Mailing-List: contact dev-help@olingo.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@olingo.apache.org Delivered-To: mailing list dev@olingo.apache.org Received: (qmail 94834 invoked by uid 99); 5 Jul 2017 05:51:02 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 05 Jul 2017 05:51:02 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id B623EC0A6B for ; Wed, 5 Jul 2017 05:51:01 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -99.21 X-Spam-Level: X-Spam-Status: No, score=-99.21 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-0.01, URIBL_BLOCKED=0.001, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id gJ7huSK8wYIl for ; Wed, 5 Jul 2017 05:51:01 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTP id CECA05FB7A for ; Wed, 5 Jul 2017 05:51:00 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 6054CE07DD for ; Wed, 5 Jul 2017 05:51:00 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 10AAF2461C for ; Wed, 5 Jul 2017 05:51:00 +0000 (UTC) Date: Wed, 5 Jul 2017 05:51:00 +0000 (UTC) From: "Ramya (JIRA)" To: dev@olingo.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (OLINGO-1129) ODataJsonSerializer Does Not Support Derived Type in $expand Option MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Wed, 05 Jul 2017 05:51:04 -0000 [ https://issues.apache.org/jira/browse/OLINGO-1129?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16074280#comment-16074280 ] Ramya commented on OLINGO-1129: ------------------------------- Hi Hui Wang, The inline data is fetched based on the inline entity set by the service developer while creating the service. The library just fetches this inline Entity and creates the response. When the service developer creates links for every navigation property he also sets the inlineEntity. When the url is http://host/service/Orders?$expand=Customer/Model.VipCustomer, the service developer should create a link for navigation property Customer and set the inline entity data to have all the properties of the derived type. When the url is of the form http://host/service/Orders?$expand=Customer/Model.VipCustomer, olingo library parses this url and sets the entryTypeFilter or collectionTypeFilter property when parsing the expand options. In this case the navigation property Customer will include the information regarding the type cast. This information can be fetched in the processor classes created by the service developer like below uriInfo.getExpandOption().getExpandItems().get(0).getResourcePath().getUriResourceParts().get(0) which will return UriResourceNavigation. Then use methods getTypeFilterOnEntry() or getTypeFilterOnCollection() to fetch the type casting information. Based on the edm entity type fetched from previous lines of code you can set correct inline entities for every navigation link created. Regards, Ramya > ODataJsonSerializer Does Not Support Derived Type in $expand Option > ------------------------------------------------------------------- > > Key: OLINGO-1129 > URL: https://issues.apache.org/jira/browse/OLINGO-1129 > Project: Olingo > Issue Type: New Feature > Components: odata4-server > Affects Versions: (Java) V4 4.3.0 > Reporter: Hui Wang > Priority: Minor > > Currently we need to use type casting to a derived type in $expand. Here is the corresponding part in the OData Protocol. > http://docs.oasis-open.org/odata/odata/v4.0/errata03/os/complete/part2-url-conventions/odata-v4.0-errata03-os-part2-url-conventions-complete.html#_Toc453752352 > To reproduce: > Here is an example URL provided in the documentation that could be used for reproducing the defect: > http://host/service/Orders?$expand=Customer/Model.VipCustomer > In the current 4.3 version, ODataJsonSerializer only deals with expand on Customer but ignores the type filter Model.VipCustomer. It means, the response would only show the content of super type Customer. Any custom properties in derived type VipCustomer wouldn't be returned. -- This message was sent by Atlassian JIRA (v6.4.14#64029)