Error while generating the OData client for IntegrationContent OData API
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:
- Download the EDMX file from https://api.sap.com/api/IntegrationContent/overview and place it in the resources folder.
- Install SAP Cloud SDK Generator.
- Run the command npx generate-odata-client --input resources/service-specs --outputDir src/generated --skipValidation --overwrite
- Generation of Odata client fails
- See error
Expected behavior The client generation should be completed successfully without any errors.
Screenshots
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.
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
Closing this as workaround provided. Please open another issue if you are still facing any issue related to the SDK.