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

Issue in Service.ts #53

Open
krishraheja opened this issue Apr 10, 2023 · 1 comment
Open

Issue in Service.ts #53

krishraheja opened this issue Apr 10, 2023 · 1 comment

Comments

@krishraheja
Copy link

krishraheja commented Apr 10, 2023

Hi Support,

Today I have implemented cds2types 3.0.0. I found one issue:

we have used types for declaring the type of fields with data type and its length in a separate file. When I executed command cds2types --cds ./srv/catalog.cds --output ./src/ --prefix I, it has created the ts files(CatalogService.ts, <namespace>.ts, other.ts and sap.common.ts.

Till here it is fine.

But when I executed npx tsc, then it gives error "error TS1005: ',' expected.".

I checked the CatalogService.ts file and found, it has import statement at line no.1, in which it has imported the fields twice.

One with types. statement and another without types. statement. It was started from second field. The first field name was coming correctly without "types." but that field was also coming twice.

When I removed the fields starting with types. and executed npx tsc, it worked fine.

Please see the below example screenshot for your reference.

image

Also the field names coming without types., are not coming in same format as its definition i.e. not coming in camel case.

P.S.- I tried by removing --prefix I, but seems no impact.

Best Regards
Krishan

@krishraheja
Copy link
Author

Hi @thisisevanfox

Could you please check the issue related to types coming in generated tsc files. I am blocked due to this issue.

Best Regards
Krishan

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant