Skip to main content

I’m trying to retrieve data from a nested JSON response of an ODATA Feed.

For testing, I try to access the “Emails” property of this ODATA example service: https://services.odata.org/V4/(S(hg4u5ox0x0r2rjva5qwwra05))/TripPinServiceRW/People

The JSON structure is as follows:

{
"@odata.id": "http://services.odata.org/V4/(S(hg4u5ox0x0r2rjva5qwwra05))/TripPinServiceRW/People('russellwhyte')",
"@odata.etag": "W/\"08DC9753B5381A6D\"",
"@odata.editLink": "http://services.odata.org/V4/(S(hg4u5ox0x0r2rjva5qwwra05))/TripPinServiceRW/People('russellwhyte')",
"UserName": "russellwhyte",
"FirstName": "Russell",
"LastName": "Whyte",
"Emails": a
"Russell@example.com",
"Russell@contoso.com"
],
"AddressInfo": I
{
"Address": "187 Suffolk Ln.",
"City": {
"CountryRegion": "United States",
"Name": "Boise",
"Region": "ID"
}
}
],
"Gender": "Male",
"Concurrency": 638551632958200400
}

 

The “Emails” property is a complex type property, which should be able to be read by the readers documentation.

Each entry represents a structured record with a key that has a list of properties of primitive or complex types.

 

But when using the ODATA reader, only the simple properties get returned:


Is there any possibility to read nested properties (JSON objects/arrays) or do I have to resort to using a HTTPCaller?

Hello @_fabian_ 

It appears the OData reader does not currently support reading Complex Type properties within a Complex Type. FMEENGINE-40129 tracks improving support for OData version 4, which should add support for reading nested complex type properties.

You may need to read the OData feed with an HTTPCaller and parse the JSON response with JSON transformers. Attached is a simple workspace demonstrating this approach, and I hope it helps.


Hello @_fabian_ 

It appears the OData reader does not currently support reading Complex Type properties within a Complex Type. FMEENGINE-40129 tracks improving support for OData version 4, which should add support for reading nested complex type properties.

You may need to read the OData feed with an HTTPCaller and parse the JSON response with JSON transformers. Attached is a simple workspace demonstrating this approach, and I hope it helps.

That’s a pity 😔 Looking forward to the improved reader! Thanks for the quick reply and clarifying the current limitations.


Reply