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: binding request field should not be returned when empty #382

Merged
merged 1 commit into from
Oct 13, 2023

Conversation

mfrancisc
Copy link
Contributor

@mfrancisc mfrancisc commented Oct 12, 2023

Description

Fix the issue with binding request field in workspace api being returned even when empty.

As the enconding/json package says, "omitempty" works only with nil pointers when dealing with structs:

The "omitempty" option specifies that the field should be omitted from the encoding if the field has an empty value, defined as false, 0, a nil pointer, a nil interface value, and any empty array, slice, map, or string.

Checks

  1. Did you run make generate target? yes

  2. Did make generate change anything in other projects? no

  3. In case of new CRD, did you the following? N/A

  4. In case other projects are changed, please provides PR links.

@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@alexeykazakov
Copy link
Contributor

Good catch!

Copy link
Contributor

@MatousJobanek MatousJobanek left a comment

Choose a reason for hiding this comment

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

👍

@mfrancisc mfrancisc merged commit 24443ff into codeready-toolchain:master Oct 13, 2023
3 checks passed
@mfrancisc mfrancisc deleted the fixbindingrequest branch October 13, 2023 09:44
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.

4 participants