OData / odata.net

ODataLib: Open Data Protocol - .NET Libraries and Frameworks
https://docs.microsoft.com/odata
Other
675 stars 348 forks source link

GET Behavior when no $select query option is given? #2946

Open uffelauesen opened 2 months ago

uffelauesen commented 2 months ago

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

xuzhg commented 2 months ago

@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.