Skip to content
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

Specify how entities returned by $compute are explicitly included in the response #2047

Open
mikepizzo opened this issue Feb 5, 2025 · 3 comments

Comments

@mikepizzo
Copy link
Contributor

mikepizzo commented Feb 5, 2025

$compute takes a common expression and assigns it an alias that is, by default, included in the response.

We state the following:
"Computed properties SHOULD be included as dynamic properties in the result and MUST be included if $select is specified with the computed property name, or star (*)."

However, since a common expression could return an entity type, should $expand be used to explicitly include in a result?

@mikepizzo mikepizzo converted this from a draft issue Feb 5, 2025
@mikepizzo
Copy link
Contributor Author

Note that we have Edm.Untyped, but a defined as Edm.Untyped must still return a structural type, and a must return an entity or collection of entities.

@mikepizzo
Copy link
Contributor Author

mikepizzo commented Feb 5, 2025

Proposal: $compute creates a dynamic property. That dynamic property may be structural or an entity (or collection of entities). If it creates a structural type then it is addressed as such ($select). If it creates an entity (or collection of entities) then it is addressed as an entity (i.e., $expand).

This is the same as any other dynamic property that could vary from instance to instance between an entity or structured property.

@mikepizzo
Copy link
Contributor Author

Resolved as proposed 2025-2-5.

@mikepizzo mikepizzo moved this from Open to Resolved in OData TC Feb 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Resolved
Development

No branches or pull requests

1 participant