You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@olingo.apache.org by "Punith DG (JIRA)" <ji...@apache.org> on 2016/12/27 06:34:58 UTC

[jira] [Created] (OLINGO-1064) Complex type is deserialized as Primitive type is the value is NULL

Punith DG created OLINGO-1064:
---------------------------------

             Summary: Complex type is deserialized as Primitive type is 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 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




--
This message was sent by Atlassian JIRA
(v6.3.4#6332)