Published Odata service: expand query option not supported?

4
Hi there, I have an Mendix Application with following two entities: Category Product   Each Category object is associated with many products. I have created an Odata Service and can access to it as expected like this: http://localhost:8080/odata/Published_OData_service/v1/ I can access to the Entities like this: Category: http://localhost:8080/odata/Published_OData_service/v1/Categories Product: http://localhost:8080/odata/Published_OData_service/v1/Products So far so good. Now my goal is to retrieve both Entities with one query. That means that I want to have a response with a list of products and the associated category to each product. According to oData V2 URI Conventions that should be achievable with the “$expand” option. Testing it with the Northwind OData V2 example worked pretty well: https://services.odata.org/OData/OData.svc/Products?$expand=Categories Therefore I created a similar Query which looks like this: https://localhost:8080/odata/Published_OData_service/v1/Products?$expand=Categories Unfortunately I receive an error message (400) as a response: <?xml version='1.0' encoding='UTF-8'?> <error xmlns="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata"> <code>400</code> <message xml:lang="en-US">$expand is not supported</message> </error>   Is the “$expand” query option not supported by Mendix? Or is there a way to enable that query option? I know that another solution could be that I just retrieve Objects from both Entities with two queries and afterwards combine/link it with the SystemID attribute on consumer side (which is in this case SAP Analytics Cloud). But I thought the expand option would be a cleaner solution. Best regards, Ömer
asked
2 answers
3

Hi Ömer,

8.11.0 has been released recently.

As Joost wrote, $expand is going to be supported from this version onwards. $expand is mentioned in the improvements section:

Published OData services now allow clients to retrieve associated data using $expand. “

https://docs.mendix.com/releasenotes/studio-pro/8.11

 

answered
1

$expand will be supported from 8.11.0 onwards. For earlier versions, it’s not supported.

answered