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

fix: ensure required query parameters with default values get sent over the wire #333

Merged
merged 2 commits into from Aug 18, 2021

Conversation

dwsupplee
Copy link
Contributor

@dwsupplee dwsupplee requested a review from a team as a code owner August 18, 2021 16:06
@google-cla google-cla bot added the cla: yes This human has signed the Contributor License Agreement. label Aug 18, 2021
$query = Psr7\parse_query($request->getUri()->getQuery());

$this->assertEquals('', $query['name']);
$this->assertEquals(0, $query['number']);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a question - what happens if no calls are made to setName and setNumber? Will the query param be empty or will the query parameter be omitted? And if that is the case, how will the API function?

Copy link
Contributor Author

@dwsupplee dwsupplee Aug 18, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what happens if no calls are made to setName and setNumber? Will the query param be empty or will the query parameter be omitted?

If no calls are made to the message class, the test results would be the same. If a query parameter is determined to be required (by the generator implementation) it will always be added to the query string as long as an explicit value or default value are set.

@dwsupplee dwsupplee merged commit 87ee2e2 into googleapis:master Aug 18, 2021
@bshaffer bshaffer mentioned this pull request Aug 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants