This repository contains a MWE for the issue Execute $count in Batch request.
The Northwind OData v2 service is used as an example.
http/
contains test HTTP requests (for VS Code extension "REST Client")service-specs/
contains the OData client required filessrc/
contains a simple script that issues two$count
requests, and the generated OData client
npm i
to install dependenciesnpm run generate-client
(or Ctrl+Shift+B in VS Code) to generate the OData client (should run automatically after installing)npm start
(or F5 in VS Code) to start the script
The script executes two $count
requests:
- the first one is executed directly (without
$batch
)- it works as expected
- have to remove the
accept
header as Northwind does not acceptapplication/json
- the second one is contained inside a
$batch
request.- this one fails
- have to disable TS checks; else it complains about the
CountRequestBuilder
not matching thebatch
signature (which only acceptsGetByKeyRequestBuilder
,GetAllRequestBuilder
, andBatchChangeSets
) - when running the script you get a runtime error:
- in the
http
test requests you can see that the server does accept$count
in$batch