How to expand multiple properties on OData

odata

Solution

According to OData ABNF, expand syntax should be:

expand = '$expand' EQ expandItem *( COMMA expandItem )

Which amounts to:

$expand=expandItem1,expandItem2,expandItem3,...

So please try:

http://services.odata.org/northwind/northwind.svc/Categories?$expand=Products/Category,Products/Supplier

For more information, see:

http://www.odata.org/documentation/odata-version-2-0/uri-conventions/#ExpandSystemQueryOption

Problem

Consider I have this OData expression: ``` http://services.odata.org/northwind/northwind.svc/Categories? $expand=Products/Category ``` It will correctly expand the `Products.Category`. Now I want to expand another property too. For example 'Products.Supplier`. I've tried duplicating the `$expand` usage: ``` http://services.odata.org/northwind/northwind.svc/Categories? $expand=Products/Category &$expand=Products/Supplier ``` but it failed returning this error: ``` Query parameter '$expand' is specified, but it should be specified exactly once. ```

Original source