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 40519200C61 for ; Tue, 25 Apr 2017 10:48:09 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 3ECF4160BB3; Tue, 25 Apr 2017 08:48:09 +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 80AE2160B9E for ; Tue, 25 Apr 2017 10:48:08 +0200 (CEST) Received: (qmail 29972 invoked by uid 500); 25 Apr 2017 08:48:07 -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 29961 invoked by uid 99); 25 Apr 2017 08:48:07 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 25 Apr 2017 08:48:07 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id BD9621B084A for ; Tue, 25 Apr 2017 08:48:06 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -99.191 X-Spam-Level: X-Spam-Status: No, score=-99.191 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001, T_FILL_THIS_FORM_SHORT=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 (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id SBatZZVVuYvX for ; Tue, 25 Apr 2017 08:48:05 +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 CDE065FBFA for ; Tue, 25 Apr 2017 08:48:04 +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 6573FE093C for ; Tue, 25 Apr 2017 08:48:04 +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 1259D21B55 for ; Tue, 25 Apr 2017 08:48:04 +0000 (UTC) Date: Tue, 25 Apr 2017 08:48:04 +0000 (UTC) From: "Ramya (JIRA)" To: dev@olingo.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (OLINGO-1064) ComplexType is deserialized as Primitive Type if the value is NULL MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Tue, 25 Apr 2017 08:48:09 -0000 [ https://issues.apache.org/jira/browse/OLINGO-1064?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15982573#comment-15982573 ] Ramya commented on OLINGO-1064: ------------------------------- The client Deserializer code is unchanged and it still returns a primitive value when complex property has a null value. However, the ODataBinder class has instance of EDM, hence we can check for the type of the property here. Please verify the fix and reopen the issue if still reproducible. > ComplexType is deserialized as Primitive Type if the value is NULL > ------------------------------------------------------------------ > > Key: OLINGO-1064 > URL: https://issues.apache.org/jira/browse/OLINGO-1064 > Project: Olingo > Issue Type: Bug > Components: odata4-client, odata4-commons > Affects Versions: (Java) V4 4.2.0 > Reporter: Punith DG > Assignee: Christian Amend > Attachments: complexType.png > > > The ODataClient deserializer wrongly converts the Complex Type field to Primitive Type field if the value received for the complex type is NULL. > e.g. on querying Person data from OData TripPin service (https://services.odata.org/TripPinRESTierService) I received below JSON response. > { > "@odata.context": "http://services.odata.org/TripPinRESTierService/(S(myhztseklikbg41mbg03ugk5))/$metadata#People(AddressInfo,FavoriteFeature,FirstName,HomeAddress,LastName,UserName)", > "value": [{ > "FavoriteFeature": "Feature1", > "FirstName": "Angel", > "Gender": "Female", > "LastName": "Huffman", > "UserName": "angelhuffman", > "AddressInfo": [{ > "Address": "55 Grizzly Peak Rd.", > "City": { > "Name": "Butte", > "CountryRegion": "United States", > "Region": "MT" > } > }], > "HomeAddress": null > }] > } > See that 'HomeAddress' is ComplexType of type 'Location' and received 'null' value. > Similarly, ComplexType property 'City' is deserialized as Primitive Type in the below response. > "HomeAddress": { > "Address": null, > "City": null > } > When you deserialize and get an entity, the HomeAddress property of the Person entity is set to Primitive Type with null value. This could be complex type? > Metadata URL - http://tinyurl.com/gm8vomc -- This message was sent by Atlassian JIRA (v6.3.15#6346)