-
Notifications
You must be signed in to change notification settings - Fork 64
Open
Labels
Description
Describe the Bug
During generation of a client for OData v4, Generator fails to generate the client if edmx Version is 4.01
instead of 4.0
. Both the versions are valid as mentioned in the OASIS ODATA documentation
Sample EDMX can be downloaded from SalesOrder (A2X) OData V4
Error Output
[2025-04-15T11:15:33.374Z] ERROR (cli): ErrorWithCause: Generation of services failed.
at /Users/<projectpath>/node_modules/@sap-cloud-sdk/generator/dist/cli.js:14:18
at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
Caused by:
TypeError: Cannot read properties of undefined (reading 'split')
at /Users/<projectpath>/node_modules/@sap-cloud-sdk/generator/dist/edmx-to-vdm/v2/entity.js:26:51
at Array.map (<anonymous>)
at navigationProperties (/Users/<projectpath>/node_modules/@sap-cloud-sdk/generator/dist/edmx-to-vdm/v2/entity.js:25:42)
at /Users/<projectpath>/node_modules/@sap-cloud-sdk/generator/dist/edmx-to-vdm/v2/entity.js:19:31
at Array.map (<anonymous>)
at generateEntitiesV2 (/Users/<projectpath>/node_modules/@sap-cloud-sdk/generator/dist/edmx-to-vdm/v2/entity.js:17:29)
at getServiceEntitiesV2 (/Users/<projectpath>/node_modules/@sap-cloud-sdk/generator/dist/edmx-to-vdm/v2/service-entities.js:14:54)
at ServiceGenerator.generateService (/Users/<projectpath>/node_modules/@sap-cloud-sdk/generator/dist/service-generator.js:27:54)
at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
at async Promise.all (index 0)
Cloud SDK Generator Version
npx generate-odata-client --version
provides output 4.0.2
Node version
Node version used 22.14.0
Steps to Reproduce
- Install the generator using following command as part of your project (local to your project)
npm install -D @sap-cloud-sdk/generator
- Execute the command to generate the client
npx generate-odata-client --input srv/external/CE_SALESORDER_0001.edmx --outputDir srv/external/clients --verbose --optionsPerService srv/external --skipValidation --overwrite
- Command errors out without any files being created.
- Following Error sample is shown:
[2025-04-15T11:15:33.374Z] ERROR (cli): ErrorWithCause: Generation of services failed.
at /Users/<projectpath>/node_modules/@sap-cloud-sdk/generator/dist/cli.js:14:18
at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
Caused by:
TypeError: Cannot read properties of undefined (reading 'split')
at /Users/<projectpath>/node_modules/@sap-cloud-sdk/generator/dist/edmx-to-vdm/v2/entity.js:26:51
at Array.map (<anonymous>)
at navigationProperties (/Users/<projectpath>/node_modules/@sap-cloud-sdk/generator/dist/edmx-to-vdm/v2/entity.js:25:42)
at /Users/<projectpath>/node_modules/@sap-cloud-sdk/generator/dist/edmx-to-vdm/v2/entity.js:19:31
at Array.map (<anonymous>)
at generateEntitiesV2 (/Users/<projectpath>/node_modules/@sap-cloud-sdk/generator/dist/edmx-to-vdm/v2/entity.js:17:29)
at getServiceEntitiesV2 (/Users/<projectpath>/node_modules/@sap-cloud-sdk/generator/dist/edmx-to-vdm/v2/service-entities.js:14:54)
at ServiceGenerator.generateService (/Users/<projectpath>/node_modules/@sap-cloud-sdk/generator/dist/service-generator.js:27:54)
at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
at async Promise.all (index 0)
Faster way to reproduce the error for contributors
- Change the version to
4.01
in sample filetest-resources > odata-service-specs > v4 > API_TEST_SRV > API_TEST_SRV.edmx
- Run the generate command
yarn generate
or Run the test commandyarn test
- Generation and Test cases would start failing
Expected Behavior
- Generation of client should succeed
- No errors should be displayed due to the version difference
Screenshots
No response
Used Versions
- Node version via
node -v
: 22.14.0 - NPM version via
npm -v
: 10.9.2 - SAP Cloud SDK version: 4.0.2
- For CAP users, CAP version: 8.8.2
Code Examples
No response
Log File
No response
Affected Development Phase
Getting Started
Impact
Blocked
Timeline
No response
Additional Context
No response