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

Fixes dderevjanik/wsdl-tsclient#15 #17

Merged

Conversation

aesweeting
Copy link
Contributor

Fixes #15

Thanks @devyourcar for the original fix suggestion!

@dderevjanik
Copy link
Owner

Wow, that's really cool.....
but I'm worried about making Array types also taking non-array type. Is this standard approach in SOAP?

@aesweeting aesweeting force-pushed the bugfix/element-case-and-arrays branch from 9d677ea to 24c529f Compare June 26, 2021 06:53
@aesweeting
Copy link
Contributor Author

but I'm worried about making Array types also taking non-array type. Is this standard approach in SOAP?

I've decided to remove that change as I don't think it's valid in this scenario. Apologies for mixing it in with this PR!


A bit of context for anyone interested:

In the case of a maxOccurs = 1, I believe node-soap transforms the element to an object instead of an array (as per the fix in vpulim/node-soap#1100) in some conditions.

I believe the issue I'm having is likely either a problem with the WSDL I'm integrating with, or with how node-soap is parsing the response.

The element is defined as maxOccurs = unbounded and I'm receiving one entry in the response XML, which I expect to be transformed to an array, but it is actually an object - which results in the types not matching. In this case, the types are correct and I believe the issue lies elsewhere.

For now, I'm just casting that part of the response as an array until I have time to investigate the problem further.

@dderevjanik
Copy link
Owner

Thank you for explaining that issue. I had several problems with how node-soap is parsing WSDL, because of that, I'm planing to replace node-soap with forked one... For example, node-soap isn't parsing documentation element, which could make generated client more usable by adding documentation to jsdoc.

@devyourcar
Copy link

Great work @aesweeting - although you missed:

  1. Adding a new cli option (--outputPascalCase) (see https://github.com/dderevjanik/wsdl-tsclient/blob/master/src/index.ts#L10)

  2. All empty changeCase calls need to pull in the pascalCase option e.g. changeCase(word) -> changeCase(word, {pascalCase: options.pascalCase})

  3. All other usages of changeCase with the pascalCase part hard-coded should remain the same.

I think the new release will be breaking, as we've essentially defaulted it to keep the casing. Should probably mention that as part of the release notes.

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

Successfully merging this pull request may close these issues.

The name of the wrapping structures are converted to camelCase
3 participants