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

update isEmptyValue function #1822

Conversation

modular-magician
Copy link
Collaborator

Added IsValid check, which handles nil objects , and updated our zero-checking logic to use the one built into go in 1.13. This fixes an issue where we were sending null to the API for all nested objects instead of omitting them from the request if they were unset.

The logic is slightly different than in our version, and the only way to really find out if it breaks anything is by running tests- I caught one already and I'll catch any others post-submit in our CI run. Conveniently, this affects fields that aren't set, so the only way we wouldn't notice it for a given resource would be if all of its tests set an Optional block (which is rare; usually we have at least one test that only sets Required fields)

@drebes fyi

Release Note Template for Downstream PRs (will be copied)

all: fixed issue where nested objects were getting sent as null values to GCP on create instead of being omitted from requests

Derived from GoogleCloudPlatform/magic-modules#2907

* update isEmptyValue function

* never mind, we still use 1.12 in the magician and teamcity

* revert bigtable change and fix flatten_object in update

Signed-off-by: Modular Magician <[email protected]>
@ghost ghost added the size/xs label Mar 4, 2020
@modular-magician modular-magician merged commit ccfba1b into hashicorp:master Mar 4, 2020
@modular-magician modular-magician deleted the downstream-pr-dd9fd0d75441273dd101eed6fe6cb03c5b5bf4dc branch November 16, 2024 03:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant