OData / OData/AspNetCoreOData

$select on AutoExpanded values with DisableWhenSelectPresent = true produces empty values

Open
#970 1 comment 0 reactions 1 assignee View on GitHub

@corranrogue9 is already working on this.

Since Jun 27, 2023.

bug
Dominant language
C#
Stars
505
Forks
186
PR merge metrics
No merged PRs in 30d

Description

Assemblies affected
ASP.NET Core OData 8.x

Describe the bug
AutoExpanded values are included in every response, even when $select is used on another property. Setting DisableWhenSelectPresent to true on the AutoExpand attribute fixes this behavior, but if the $select is used on an auto-expanded property when this is set to true, it returns an empty value(s).

Reproduce steps

  1. Set DisableWhenSelectPresent to true on the AutoExpand attribute
  2. Call odata url with $select={autoExpandedProperty}

Data Model
image

EDM (CSDL) Model
https://microsoftgraph.visualstudio.com/onboarding/_git/onboarding?path=/reviews/15686-epm-get-permissions-analytics/schema.csdl&version=GBmaster

Request/Response
image

Expected behavior
For the auto-expanded property to be able to be selected, as well as every other property to be able to be selected without including the auto-expanded property in the response.

Screenshots
If applicable, add screenshots to help explain your problem.

Additional context
Please share your call stack or any error message
Add any other context about the problem here.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.