OData endpoints sometimes need to serve up complex objects with quite a few root level properties. Typically these are modeled as value objects, so I might have the following:
* Customer entity
* Value object for PrimaryAddress
* Entity association for Country
Typically consumers want to select fields from value objects in the same manner as fields from entities. A consumer can legally select child fields from entities like this ($expand must be used):
* /odata/customers?$top=10&$expand=Country&$select=Country/Name
Whereas if a consumer tries to select fields from value objects like this:
* /odata/customers?$top=10&$select=PrimaryAddress/Line1
Then the following error is returned:
* 'Inner or start path segments must be navigation properties in $select'
I understand that value objects like PrimaryAddress are not navigation properties so I cannot use $expand with them. It feels natural for consumers to be able to pull just the fields they need via $select though.
So just thought I'd ask if this is expected behaviour or if this is expected to change for the next Web API release?
* Customer entity
* Value object for PrimaryAddress
* Entity association for Country
Typically consumers want to select fields from value objects in the same manner as fields from entities. A consumer can legally select child fields from entities like this ($expand must be used):
* /odata/customers?$top=10&$expand=Country&$select=Country/Name
Whereas if a consumer tries to select fields from value objects like this:
* /odata/customers?$top=10&$select=PrimaryAddress/Line1
Then the following error is returned:
* 'Inner or start path segments must be navigation properties in $select'
I understand that value objects like PrimaryAddress are not navigation properties so I cannot use $expand with them. It feels natural for consumers to be able to pull just the fields they need via $select though.
So just thought I'd ask if this is expected behaviour or if this is expected to change for the next Web API release?