Skip to Content

Do xsodata models support nested $expand queries?

Apr 05 at 07:22 AM


avatar image

I have an odata query which I believe to be valid, which is receiving an error from my Neo XS runtime. It includes a nested $expand:


The resultant error shows that the parenthesis are not being respected:

"Syntax error in $expand system query option at position '28': entityNavProperty 'expenseitem($expand=currency' is not a valid navigation property for type ''."<br>

Queried independently, $expand=expenseitem on the principal expensereport, and $expand=currency,expenseType,paymentType on the principal expenseitem behave as expected.

Any guidance here?

HANA Workbench v1.120.20.

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Thomas Jung
Apr 05 at 08:06 AM

From what I’m reading online and in the OData specification this would seem to be a new syntax feature of OData V4. XSODATA is V2.

Here is the entire specification for $expand in OData V2:

ere is the same section in OData V4:

Note the section above about query options that can be applied to the expanded navigation.

Query options can be applied to the expanded navigation property by appending a semicolon-separated list of query options, enclosed in parentheses, to the navigation property name. Allowed system query options are $filter, $select, $orderby, $skip, $top, $count, $search, and $expand.

This is also listed in the What’s New features of OData V4:

2.6.4 Improved: $expand

Expanded entities can now be filtered, ordered, paged, projected, cast, … , and of course further expanded through a more composable, nested syntax.

10 |10000 characters needed characters left characters exceeded