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 922CC200BEA for ; Tue, 27 Dec 2016 07:38:00 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 90CE7160B31; Tue, 27 Dec 2016 06:38:00 +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 E212E160B23 for ; Tue, 27 Dec 2016 07:37:59 +0100 (CET) Received: (qmail 537 invoked by uid 500); 27 Dec 2016 06:37:58 -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 519 invoked by uid 99); 27 Dec 2016 06:37:58 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 27 Dec 2016 06:37:58 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 783C32C022B for ; Tue, 27 Dec 2016 06:37:58 +0000 (UTC) Date: Tue, 27 Dec 2016 06:37:58 +0000 (UTC) From: "Punith DG (JIRA)" To: dev@olingo.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (OLINGO-1064) Complex type 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, 27 Dec 2016 06:38:00 -0000 [ https://issues.apache.org/jira/browse/OLINGO-1064?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Punith DG updated OLINGO-1064: ------------------------------ Description: 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. 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 was: 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 of complex type and received value is 'null'. When you deserialize and get an entity, the HomeAddress (ComplexType of type 'Location') property of the Person entity is set to Primitive Type with null value. Metadata URL - http://tinyurl.com/gm8vomc > Complex type 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: odata2-core, odata4-client, odata4-commons > Affects Versions: (Java) V4 4.2.0 > Reporter: Punith DG > > 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. > 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.4#6332)