Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot generate client consuming entity named "Service" #3041

Closed
Jibbril opened this issue Nov 9, 2022 · 6 comments
Closed

Cannot generate client consuming entity named "Service" #3041

Jibbril opened this issue Nov 9, 2022 · 6 comments
Assignees
Labels
bug Something isn't working

Comments

@Jibbril
Copy link

Jibbril commented Nov 9, 2022

Describe the bug
I am currently trying to upgrade from using the SAP Cloud SDK version 1.54.2 for javascript to version 2.10.0 and I am running into an issue. I'm looking to generate an oData client, and everything works as intended in the v1 SDK. However, in v2 there is a file called "service.ts" generated automatically when creating the client which is not there in v1. This causes an issue for me since one of the entities in the service I am consuming is named "Service" (capital S). Thus there is both a "service.ts" and a "Service.ts" generated in the client folder, which causes the generator to crash.

To Reproduce
Steps to reproduce the behavior:

  1. Setup an odata v2 service with an exposed entity named "Service".
  2. Fetch the edmx of the service.
  3. Use the fetched edmx to generate an odata client using the generate-odata-client command.

Expected behavior
An odata client is generated in the specified output folder.

Used Versions:

  • node version: 16.17.1
  • npm version: 8:15.0
  • SAP Cloud SDK version: 2.10.0

Log file
The error message when the generator crashes:

error TS1149: File name '.../service.ts' differs from already included file name '.../Service.ts' only in casing.

Impact / Priority
Upgrading to version 2 is quite important since v1 is no longer being supported.

Affected development phase: Development

Impact: Impaired

Timeline: Ideally end of week, latest next week.

Additional context
I posted a question on the sap answers.com forums here.

Image of the files being generated in the client folder:
image

Any help would be much appreciated!

Best regards,
Jibbril

@Jibbril Jibbril added the bug Something isn't working label Nov 9, 2022
@jjtang1985
Copy link
Contributor

jjtang1985 commented Nov 9, 2022

Hi @Jibbril ,

Thanks for raising up.

Could you please share the edmx specification file so we can reproduce?
You can also share the service name, if we can download it from the SAP API Business Hub

Alternatively, you can also share the part that contains entities with the name "Service".

Best regards,
Junjie

@Jibbril
Copy link
Author

Jibbril commented Nov 9, 2022

I am unable to share these things due to secrecy issues, I have however created a small SAP CAP repo here reproducing the issue. Check the readme for instructions.

Best regards,
Jibbril

@jjtang1985
Copy link
Contributor

Hi @Jibbril ,

Understood.
Thanks for sharing the CAP model, which is useful.

We'll work on it soon and will update you.

FYI, we are working on the next major version update, I hope we can finish it next week, but I cannot make a promise.

@jjtang1985
Copy link
Contributor

Hi @Jibbril ,

The fix was merged last week and you can test the canary version now.
We'll release a new stable version next week.

Please let me know, whether it works.
Best regards,
Junjie

@Jibbril
Copy link
Author

Jibbril commented Nov 24, 2022

Hello @jjtang1985,

I checked out the canary version and it seems to be working now. Looking forward to the stable version, thanks a lot!

Best Regards,
Jibbril

1 similar comment
@Jibbril
Copy link
Author

Jibbril commented Nov 24, 2022

Hello @jjtang1985,

I checked out the canary version and it seems to be working now. Looking forward to the stable version, thanks a lot!

Best Regards,
Jibbril

@Jibbril Jibbril closed this as completed Nov 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants