odata.net icon indicating copy to clipboard operation
odata.net copied to clipboard

GET Behavior when no $select query option is given?

Open uffelauesen opened this issue 1 year ago • 1 comments

Does the reference TripPin V4 Service follow protocol recommendations?

Assemblies affected

The assemblies that are used for the reference service at https://services.odata.org/TripPinRESTierService/

Reproduce steps

The OData V4.01 URL Conventions document at https://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part2-url-conventions.html#_Toc31361040 states under $select system query option that:

Any structural property, non-expanded navigation property, or operation not requested as a select item (explicitly or via a star) SHOULD be omitted from the response.

Issue a GET request to the reference service's People entity set without a $select:

https://services.odata.org/TripPinRESTierService/People

Expected result

Shouldn't the reference service follow the conventions strictly. I do know the docs states "SHOULD" and not "MUST", but shouldn't it? From the documentation I would expect to get some minimal representation back like only the @odata.id.

Actual result

The service returns the full entities with all properties - exactly the same as if we include a $select=*

Additional detail

Please also see #2938

uffelauesen avatar Apr 25 '24 10:04 uffelauesen

@uffelauesen Is there a condition?

If a select is given in the request, then: Any structural property, non-expanded navigation property, or operation not requested as a select item (explicitly or via a star) SHOULD be omitted from the response.

xuzhg avatar Apr 29 '24 21:04 xuzhg

Behaviour explained in comment. When no $select is present, all structural properties should be returned

gathogojr avatar Feb 17 '25 07:02 gathogojr