Issue in Service.ts
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.
When I removed the fields starting with types. and executed npx tsc, it worked fine.
Please see the below example screenshot for your reference.
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
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