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

Type-hinting ?string for type="xs:anySimpleType" seems to be wrong #323

Open
etshy opened this issue Nov 7, 2024 · 2 comments
Open

Type-hinting ?string for type="xs:anySimpleType" seems to be wrong #323

etshy opened this issue Nov 7, 2024 · 2 comments
Assignees
Labels

Comments

@etshy
Copy link

etshy commented Nov 7, 2024

Describe the bug
I have a WSDL (I can't share it) that have an object with an attribute of type type="xs:anySimpleType"

It was generated with a php type hint ?string
But when that value is empty in the Response (<Element attribute="">), the SoapClient seems to generate an empty stdClass instead of an empty string or null and thus it throws an Exception.

The generator used was v4.1.12

To Reproduce
Steps to reproduce the behavior:

  • During the package generation
    We used standalone=false --force

  • During the usage of the generated package
    I'm using the generated classes to make the call, the generated classmap, nothing special

Expected behavior
With a type any, the property should not be typed, as it can literally be anything.

@mikaelcom
Copy link
Member

I would way that in this casse :mixed would be more appropriate then, I was not aware of this specificity

@etshy
Copy link
Author

etshy commented Nov 11, 2024

I wasn't aware too and couldn't find anything "official" about that.
But I noticed that on some response payload, and found just a few StackOverflow post and it seems to work that way.

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

No branches or pull requests

2 participants