Open boghyon opened 2 years ago
@ralfhandl @mikepizzo Could you confirm whether the "results"
property is a MUST in the above case with $top
? Or is it optional? V2 sample services by SAP do include the "results"
property even with $top
expectedly.
That's surprising behavior. The query options $top
and $skip
should just change the included entities and not change the response shape.
Similar to the issue https://github.com/OData/ODataSamples/issues/119, the reference service Northwind does currently not comply with the OData V2 specification if the request URL contains the system query option
$top
.Bad example: https://services.odata.org/V2/Northwind/Northwind.svc/Products?$format=json&$top=2 See that the response starts with
{"d":[
without the"results"
. The specification, however, mandates to respond with the"results"
property if a collection is requested. See the topic "2.2.6.3.2 Entity Set (as a JSON Array)" on page 101.Good example: https://services.odata.org/V2/Northwind/Northwind.svc/Products?$format=json&$skip=2 See that the response starts correctly with
{"d":"results":[
if the$top
is not included in the URL.