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

Refactor PHP client to parse data as actual types #930

Open
sbrattla opened this issue Jan 11, 2019 · 3 comments
Open

Refactor PHP client to parse data as actual types #930

sbrattla opened this issue Jan 11, 2019 · 3 comments

Comments

@sbrattla
Copy link

sbrattla commented Jan 11, 2019

The PHP XML client currently parses all data as string. I'd really like it to at least parse boolean values as boolean, but I'm uncertain about the consequences.

If anyone out there use the PHP XML client, they'd might now be doing isAvailable() === 'true', and if I commit a patch for the parser this would turn into a false since isAvailable() would not equal a boolean true with ===.

On the other hand, it's much easier to work with booleans as boolean. That would allow me to do isAvailable() without the explicit === 'true'.

Maybe both variations could be supported by allowing a configurable variable for the PHP XML client module, something like useRealTypes?

Note! I'd be more than happy to contribe with a patch. I'd just like to hear if this could have unforeseen consequences.

What's your thoughts on this @stoicflame?

@stoicflame
Copy link
Owner

I'm not too concerned about backwards compatibility for the generated client code. I'd say just submit the patch and let people deal with the compatibility issues.

@stoicflame stoicflame added this to the 2.12.0 milestone Jan 11, 2019
@sbrattla
Copy link
Author

sbrattla commented Jan 11, 2019 via email

@stoicflame
Copy link
Owner

Yes, variables are passed into the freemarker template via the "model" (it's just a map).

See PHPXMLClientModule lines 161-172.

@stoicflame stoicflame removed this from the 2.12.0 milestone Aug 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants