$expand Contains Incorrect Context Link
@mikepizzo is already working on this.
Since Aug 3, 2017.
- Dominant language
- C#
- Stars
- 864
- Forks
- 467
- PR merge metrics
- No merged PRs in 30d
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": [
{
...,
"entity4@odata.context": "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": [
{
...,
"entity4@odata.context": "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."
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.