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

Boolean representation on GuzzleHttp\Psr7\build_query() #264

Closed
ackintosh opened this issue Feb 24, 2019 · 1 comment · Fixed by #391
Closed

Boolean representation on GuzzleHttp\Psr7\build_query() #264

ackintosh opened this issue Feb 24, 2019 · 1 comment · Fixed by #391
Milestone

Comments

@ackintosh
Copy link

ackintosh commented Feb 24, 2019

$data = [
    'true' => true,
    'false' => false
];

/*
 * GuzzleHttp\Psr7\build_query()
 */
var_dump(GuzzleHttp\Psr7\build_query($data));
// string(13) "true=1&false="

/*
 * \http_build_query()
 */
var_dump(\http_build_query($data));
// string(14) "true=1&false=0"

GuzzleHttp\Psr7\build_query() resolves false to '' but I think it should be 0 as well as \http_build_query().

I'll file a PR if it's reasonable for you too.

@Tobion Tobion added this to the 2.0.0 milestone May 15, 2020
@pierrre
Copy link

pierrre commented Mar 8, 2021

FYI this code is called by swagger-codegen.
All code generated by swagger-codegen is broken currently.

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 a pull request may close this issue.

3 participants