Is there an existing issue for this?
Current Behavior
When a CDS service is annotated with @protocol: 'rest', the OpenAPI compiler still generates a /$batch path item in the output, but it is specific to OData.
Expected Behavior
The compiler should not generate /$batch endpoint for REST services.
Steps To Reproduce
- Define a REST CDS service:
@path : '/rest/v1/myRestAPI'
@protocol: 'rest'
service MyRestAPI {
action send();
}
cds compile <file>.cds --to openapi
- Inspect the generated file
Environment
| Package | Version | Location |
| ---------------------- | ------- | ---------------------------------------------------------- |
| @sap/cds-dk | 9.9.1 | ./node_modules/@sap/cds-dk |
| @sap/cds | 9.6.4 | ./node_modules/@sap/cds |
| @sap/cds-compiler | 6.6.2 | ./node_modules/@sap/cds-compiler |
| @sap/cds-fiori | 2.1.1 | ./node_modules/@sap/cds-fiori |
| @sap/cds-mtxs | 3.9.7 | ./node_modules/@sap/cds-mtxs |
| @cap-js/asyncapi | 1.1.0 | ./node_modules/@cap-js/asyncapi |
| @cap-js/cds-test | 0.4.1 | ./node_modules/@cap-js/cds-test |
| @cap-js/cds-types | 0.15.0 | ./node_modules/@cap-js/cds-types |
| @cap-js/db-service | 2.8.1 | ./node_modules/@cap-js/db-service |
| @cap-js/hana | 2.5.1 | ./node_modules/@cap-js/hana |
| @cap-js/openapi | 1.6.0 | ./node_modules/@cap-js/openapi |
| @cap-js/ord | 1.9.3 | ./node_modules/@cap-js/ord |
| @cap-js/sqlite | 2.1.2 | ./node_modules/@cap-js/sqlite |
| @cap-js/sqlite | 2.4.0 | ./node_modules/@sap/cds-dk/node_modules/@cap-js/sqlite |
| @cap-js/telemetry | 2.0.1 | ./node_modules/@cap-js/telemetry |
| @sap/eslint-plugin-cds | 2.7.0 | ./node_modules/@sap/eslint-plugin-cds |
| cds.home | | ./node_modules/@sap/cds |
| npm root -l | | ./node_modules |
| npm root -g | | ~/.nvm/versions/node/v22.23.1/lib/node_modules |
| Node.js | 22.23.1 | ~/.nvm/versions/node/v22.23.1/bin/node |
Repository Containing a Minimal Reproducible Example
No response
Anything else?
There is a workaround by annotating the service with @Capabilities.BatchSupported: false, so there is no urgency in this one.
Is there an existing issue for this?
Current Behavior
When a CDS service is annotated with
@protocol: 'rest', the OpenAPI compiler still generates a/$batchpath item in the output, but it is specific to OData.Expected Behavior
The compiler should not generate
/$batchendpoint for REST services.Steps To Reproduce
cds compile <file>.cds --to openapiEnvironment
Repository Containing a Minimal Reproducible Example
No response
Anything else?
There is a workaround by annotating the service with
@Capabilities.BatchSupported: false, so there is no urgency in this one.