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] Do not send query parameters when set to zero value #1136

Merged
merged 2 commits into from
Jan 23, 2025

Conversation

mgyucht
Copy link
Contributor

@mgyucht mgyucht commented Jan 23, 2025

What changes are proposed in this pull request?

#1124 fixed the handling of APIs that use query parameters and a body simultaneously. After that change, query parameters are always sent, even if set to the zero value.

This PR addresses this, using the same logic for query parameters as for fields in the body: if a field is set to its zero value, it will be included in the query parameter if it is present in ForceSendFields.

How is this tested?

This behavior is dependend upon in the Terraform provider. I'll be using it in databricks/terraform-provider-databricks#4430 and verifying that there is no behavior change in the generated request.

When using this PR in Terraform, tests asserting that the path doesn't include query parameters pass.

@mgyucht mgyucht temporarily deployed to test-trigger-is January 23, 2025 10:29 — with GitHub Actions Inactive
Copy link

If integration tests don't run automatically, an authorized user can run them manually by following the instructions below:

Trigger:
go/deco-tests-run/sdk-go

Inputs:

  • PR number: 1136
  • Commit SHA: 59316ff5d113f266874b998e5794f85e81abeeb3

Checks will be approved automatically on success.

@mgyucht mgyucht temporarily deployed to test-trigger-is January 23, 2025 10:31 — with GitHub Actions Inactive
@mgyucht mgyucht added this pull request to the merge queue Jan 23, 2025
Merged via the queue into main with commit 18cebf1 Jan 23, 2025
15 checks passed
@mgyucht mgyucht deleted the only-send-nonempty-query-parameters branch January 23, 2025 12:12
mgyucht added a commit that referenced this pull request Jan 23, 2025
### Bug Fixes

 * Do not send query parameters when set to zero value ([#1136](#1136)).
github-merge-queue bot pushed a commit that referenced this pull request Jan 23, 2025
### Bug Fixes

* Do not send query parameters when set to zero value
([#1136](#1136)).
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.

2 participants