mendix / RestServices

REST service module for Mendix. Supports consuming and publishing REST based services and real-time data synchronization. Supports JSON, form-encoded, multipart and binary data transport.
Apache License 2.0
31 stars 46 forks source link

Unable to parse JSON result containing repeating values #43

Closed erorive closed 9 years ago

erorive commented 9 years ago

When I try to parse the below json result from Google I get an parse error on the types attribute. I believe the reason could be a types attribute can have repeating values. Or the REST component fails to map it to a domain model.

"results" : [ { "address_components" : [ { "long_name" : "1600", "short_name" : "1600", "types" : [ "street_number" ] }, { "long_name" : "Amphitheatre Pkwy", "short_name" : "Amphitheatre Pkwy", "types" : [ "route" ] }, { "long_name" : "Mountain View", "short_name" : "Mountain View", "types" : [ "locality", "political" ] }, { "long_name" : "Santa Clara", "short_name" : "Santa Clara", "types" : [ "administrative_area_level_2", "political" ] }, { "long_name" : "California", "short_name" : "CA", "types" : [ "administrative_area_level_1", "political" ] }, { "long_name" : "United States", "short_name" : "US", "types" : [ "country", "political" ] }, { "long_name" : "94043", "short_name" : "94043", "types" : [ "postal_code" ] } ], "formatted_address" : "1600 Amphitheatre Pkwy, Mountain View, CA 94043, USA", "geometry" : { "location" : { "lat" : 37.42291810, "lng" : -122.08542120 }, "location_type" : "ROOFTOP", "viewport" : { "northeast" : { "lat" : 37.42426708029149, "lng" : -122.0840722197085 }, "southwest" : { "lat" : 37.42156911970850, "lng" : -122.0867701802915 } } }, "types" : [ "street_address" ] } ], "status" : "OK" }

mweststrate commented 9 years ago

Hi,

For the 'types' in the example document, you should create a referenceset named 'types', and point it toward the RestServices.Primitive entity. After parsing, the reference will hold two instances of Primitive with expected values inside it.

erorive commented 9 years ago

Thanks,

I will set it up.

Kind regards Erno

Sent from a tiny device

On 06 Oct 2014, at 19:34, Michel Weststrate notifications@github.com wrote:

Hi,

For the 'types' in the example document, you should create a referenceset named 'types', and point it toward the RestServices.Primitive entity. After parsing, the reference will hold two instances of Primitive with expected values inside it.

— Reply to this email directly or view it on GitHub.