-
Notifications
You must be signed in to change notification settings - Fork 474
Open
Labels
Description
Observed in System.Web.OData 5.9.1 & 6.0.0
I have exposed the the following endpoint:
/entity1('key')/entity2('key')/entity3('key')/entity4('key')
When I execute /entity1('key')/entity2('key')/entity3?$expand=entity4 I receive a JSON response with the correct "@odata.context":
"@odata.context": "https://host:port/$metadata#entity1('key')/entity2('ket')/entity3",
"value": [
{
...,
"[email protected]": "https://host:port/$metadata#entity1('key')/entity2('key')/entity3('key')/entity4",
"entity4": [
{
...
}
]
},
...
When I execute /entity1('key')/entity2('key')/entity3('key')?$expand=entity4 however, I receive an incorrect "@odata.context" with two keys:
"@odata.context": "https://host:port/$metadata#entity1('key')/entity2('ket')/entity3",
"value": [
{
...,
"[email protected]": "https://host:port/$metadata#entity1('key')/entity2('key')/entity3('key')('key')/entity4",
"entity4": [
{
...
}
]
}
This causes an exception when executing with Microsoft's OData Client:
"The context URL 'https://host:port/$metadata#entity1('key')/entity2('key')/entity3('key')('key')/entity4' is invalid."