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

Invalid generated TS type on schema with param case elements/attributes #18

Closed
darcien opened this issue Jun 28, 2021 · 4 comments
Closed
Labels
bug Something isn't working

Comments

@darcien
Copy link

darcien commented Jun 28, 2021

TL;DR when the schema have param case (like-this), the generated TS types will be invalid.

Unfortunately I'm not allowed to share the full WSDL schema.
But I can provide an example.

For example, with this complex type:
image

The generated TS will look like this:
image

To make the generated TS valid, we just need to wrap the object property with quote mark like:
image

This issue is happening since v1.2.0.

This doesn't hapeen in v1.1.4.

Might be related to the changes happening in #17

Thanks for the great package by the way, you guys rock 🤘

@dderevjanik
Copy link
Owner

Hi, thanks !

I checked #17 and it just reveals bug. Until now, every property name was camelcased, which is wrong ! It'll throw an error in runtime. So, instead of camelcasing property name, it should prefix all generated property names with " as in your screenshot.

@dderevjanik
Copy link
Owner

Weird thing that ts-morph doesn't automatically generates " for property name, which consist from -
source: dsherret/ts-morph#1160

@dderevjanik
Copy link
Owner

@darcien @starscoccer please, could you test latest dev version of wsdl-tsclient with your wsdl files ?

npm i -g wsdl-tsclient@dev should install wsdl-tsclient@1.3.1-alpha.0 - this version should work with Human_Resource.wsdl file.

@darcien
Copy link
Author

darcien commented Jun 30, 2021

Works for me now, thanks for fixing this quickly ♥️

@darcien darcien closed this as completed Jun 30, 2021
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