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 D1FD3200C81 for ; Fri, 12 May 2017 04:47:10 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id D0CE3160BCA; Fri, 12 May 2017 02:47:10 +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 21DB5160BC7 for ; Fri, 12 May 2017 04:47:09 +0200 (CEST) Received: (qmail 13693 invoked by uid 500); 12 May 2017 02:47:09 -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 13682 invoked by uid 99); 12 May 2017 02:47:09 -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; Fri, 12 May 2017 02:47:09 +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 C4FAB1AFC0C for ; Fri, 12 May 2017 02:47:08 +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-eu.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id GlTOAc9C_CjJ for ; Fri, 12 May 2017 02:47:07 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTP id 1D29760EAD for ; Fri, 12 May 2017 02:47:07 +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 440EFE0C0D for ; Fri, 12 May 2017 02:47:06 +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 EE84B24303 for ; Fri, 12 May 2017 02:47:04 +0000 (UTC) Date: Fri, 12 May 2017 02:47: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: Fri, 12 May 2017 02:47:11 -0000 [ https://issues.apache.org/jira/browse/OLINGO-1064?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16007555#comment-16007555 ] Ramya commented on OLINGO-1064: ------------------------------- Hi Frederik Zimmer, Can you please create a new bug please. Regards, Ramya > 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 > Fix For: (Java) V4 4.4.0 > > Attachments: complexType.png, OLINGO-1064.diff > > > 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)