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

[Php] Convert boolean value for query string (Configuration) #12385

Merged
merged 10 commits into from May 25, 2022
Merged

[Php] Convert boolean value for query string (Configuration) #12385

merged 10 commits into from May 25, 2022

Conversation

ksvirkou-hubspot
Copy link
Contributor

@ksvirkou-hubspot ksvirkou-hubspot commented May 17, 2022

This PR creates an property in configuration "booleanFormatForQueryString"
User can set the format for conversation of boolean to the query string
user can set int (param=1 or param=0) or string (param=true or param=false)
int is default format because guzzle/psr7 converts boolean to int (param=1 or param=0)

example of use

$config = new Configuration();
$config->setBooleanFormatForQueryString(Configuration::BOOLEAN_FORMAT_STRING);
$config::setDefaultConfiguration($config);

$api = new APIClass($client, $config);

it will fix #11683

PR checklist

  • Read the contribution guidelines.
  • Pull Request title clearly describes the work in the pull request and Pull Request description provides details about how to validate the work. Missing information here may result in delayed response from the community.
  • Run the following to build the project and update samples:
    ./mvnw clean package 
    ./bin/generate-samples.sh
    ./bin/utils/export_docs_generators.sh
    
    Commit all changed files.
    This is important, as CI jobs will verify all generator outputs of your HEAD commit as it would merge with master.
    These must match the expectations made by your contribution.
    You may regenerate an individual generator by passing the relevant config(s) as an argument to the script, for example ./bin/generate-samples.sh bin/configs/java*.
    For Windows users, please run the script in Git BASH.
  • If your PR is targeting a particular programming language, @mention the technical committee members, so they are more likely to review the pull request.

@ksvirkou-hubspot ksvirkou-hubspot changed the title Feature/query string bool value [Php] Convert boolean value for query string May 17, 2022
@ksvirkou-hubspot
Copy link
Contributor Author

@ksvirkou-hubspot ksvirkou-hubspot changed the title [Php] Convert boolean value for query string [Php] Convert boolean value for query string (Configuration) May 23, 2022
@ksvirkou-hubspot
Copy link
Contributor Author

Any updates?
@ybelenko @wing328

@wing328
Copy link
Member

wing328 commented May 23, 2022

I'm ok with it. If no further feedback/question for this PR, I'll merge it tomorrow.

Thanks for the PR.

@ybelenko
Copy link
Contributor

Just checked locally under php 8.1.6:

vendor/bin/phpunit tests/ObjectSerializerTest.php
PHPUnit 9.5.20

................................................................. 65 / 65 (100%)


Time: 00:00.087, Memory: 6.00 MB

OK (65 tests, 76 assertions)

The code looks fine. 👍

@wing328 wing328 merged commit 45cbd5f into OpenAPITools:master May 25, 2022
@ksvirkou-hubspot ksvirkou-hubspot deleted the feature/queryStringBoolValue branch May 25, 2022 10:26
@wing328 wing328 added this to the 6.0.0 milestone May 26, 2022
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.

[REQ] [Php] Convert boolean value for query string
3 participants