cloud-sdk-js icon indicating copy to clipboard operation
cloud-sdk-js copied to clipboard

Error while generating the OData client for IntegrationContent OData API

Open sagarbansal106 opened this issue 1 year ago • 1 comments

Describe the bug A clear and concise description of what the bug is. While generating the OData client using the SDK generator for the IntegrationContent API, I am getting error of 'Duplicate Identifier'.

To Reproduce Steps to reproduce the behavior:

  1. Download the EDMX file from https://api.sap.com/api/IntegrationContent/overview and place it in the resources folder.
  2. Install SAP Cloud SDK Generator.
  3. Run the command npx generate-odata-client --input resources/service-specs --outputDir src/generated --skipValidation --overwrite
  4. Generation of Odata client fails
  5. See error

Expected behavior The client generation should be completed successfully without any errors.

Screenshots image

Used Versions:

  • node version via node -v : v18.14.2
  • npm version via npm -v : 9.5.0
  • SAP Cloud SDK version you used as dependency : ^3.14.0

Code Examples If applicable, add code snippets as examples to help explain your problem. Please remove sensitive information.

Log file If applicable, add your log file or related error message. Again, please remove your sensitive information.

Impact / Priority

Affected development phase: Development

Impact: Blocked

Timeline: Go-Live is in 4 weeks.

Additional context Add any other context about the problem here.

sagarbansal106 avatar May 01 '24 13:05 sagarbansal106

Hi @sagarbansal106,

it looks like the service specification has a duplicated entry in it's EntityContainer:

<EntitySet Name="IntegrationRuntimeArtifacts" EntityType="com.sap.hci.api.IntegrationRuntimeArtifact"/>

The line above appears twice, once in line 386 and once again in line 404. If I remove the second occurrence, everything seems to work as expected.

So as a workaround, you could manually edit the specification. Additionally, I suggest that you reach out to the service maintainers and ask them to fix their specification file.

Hope that helps!

Best regards, Johannes

Johannes-Schneider avatar May 02 '24 13:05 Johannes-Schneider

Closing this as workaround provided. Please open another issue if you are still facing any issue related to the SDK.

deekshas8 avatar May 31 '24 12:05 deekshas8