-
Notifications
You must be signed in to change notification settings - Fork 349
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
OData.Client - Projection on expanded paths produces long query with redundant parts #3047
Comments
This is a bug according to the standard:
|
@uffelauesen What is the end goal The expected URL is not returning any data. Getting: {
"error": {
"code": "",
"message": "An error has occurred."
}
} |
@WanjohiSammy |
@WanjohiSammy |
@WanjohiSammy |
OData.Client produces unnecessary long URIs with a lot of repeated redundancy for projected expand paths.
Assemblies affected
OData.Client .Net lib 7.x and 8.x
Reproduce steps
Using the TripPin service consider the following query on People that expands and projects BestFriend (and BestFriend's Friends) and Friends...
Expected result
The query/request produced would have projected properties ($select) inside a single expand path making the query/request as short as possible, like...
/People?$expand=BestFriend($select=UserName,FirstName,LastName,Age;$expand=Friends($select=UserName,FirstName,LastName,Age)),Friends($select=UserName,FirstName,LastName,Age)&$select=UserName
Actual result
The expand paths are repeated for each projected property...
/People?$expand=BestFriend($select=UserName),BestFriend($select=FirstName),BestFriend($select=LastName),BestFriend($select=Age),BestFriend($expand=Friends($select=UserName)),BestFriend($expand=Friends($select=FirstName)),BestFriend($expand=Friends($select=LastName)),BestFriend($expand=Friends($select=Age)),Friends($select=UserName),Friends($select=FirstName),Friends($select=LastName),Friends($select=Age)&$select=UserName
Additional detail
The order of properties and expand/select could be different from the expected result, but the structure should be intact.
The text was updated successfully, but these errors were encountered: