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

Generated types clash and fail to compile #25

Open
BernhardPosselt opened this issue Aug 23, 2021 · 5 comments
Open

Generated types clash and fail to compile #25

BernhardPosselt opened this issue Aug 23, 2021 · 5 comments

Comments

@BernhardPosselt
Copy link

I've got the following WSDL spec which fails to compile with

gensrc/oil/salesorderv201901/definitions/ProductLineItemUpdateOrderRequest.ts:1:33 - error TS1149: File name 'gensrc/oil/salesorderv201901/definitions/ProductLineItem.ts' differs from already included file name 'gensrc/oil/salesorderv201901/definitions/ProductLineitem.ts' only in casing.

SalesOrder_v201901.txt

@Clovel
Copy link

Clovel commented Oct 4, 2022

Any news on this or #46 ? Have any maintainers went through this ?

@Clovel
Copy link

Clovel commented Oct 4, 2022

I have a similar situation where the wsdl-tsclient CLI made duplicates :

image

Any idea how I could fix this ?

@pazoozooCH
Copy link

I ended up just manually adding aliases for the clashing names, like:

export { WebPaymentApi as WebPaymentApiService } from "./services/WebPaymentApi";
export { WebPaymentApi as WebPaymentApiPort } from "./ports/WebPaymentApi";

Same in the services/WebPaymentApi.ts file (alias for port).

I don't mind that much as I only have one service and my wsdl is quite stable. But would be nice if the the tool would detect those kind of duplications itself - or at least provide a standardized way to provide aliases. It seems like it's not very unlikely that a real-life wsdl would result in duplications like that...

If it would bother me more and/or I had the time, I might try to fix it myself with a pull request...

@Clovel
Copy link

Clovel commented Nov 9, 2022

If fixed this using a JS script that patches the files after having generated the code. It's more of a workaround than a real fix of the wsdl-tsclient library.

I can share the script if you want to. I used regular expressions to find and replace the duplicates.

const lServiceExportRegEx = /export { ([A-Za-z]*) } from ".\/services\/\1";/gm;
const lPortExportRegEx = /export { ([A-Za-z]*) } from ".\/ports\/\1";/gm;
const lPortImportRegEx = /import { ([A-Za-z]*) } from "..\/ports\/\1";/gm;
const lServiceInterfaceRegEx = /readonly ([A-Za-z]*): \1;/gm;

const lServiceSubValue = `export { $1 as $1Service } from "./services/$1";`;
const lPortSubValue = `export { $1 as $1Port } from "./ports/$1";`;
const lPortImportSubValue = `import { $1 as $1Port } from "../ports/$1";`;
const lServiceInterfaceSubValue = `readonly $1: $1Port;`;

@extradosages
Copy link

extradosages commented Mar 21, 2023

Still an issue for us.

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

4 participants