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(pipeline_config): fix model template bool property #33

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Nkmol
Copy link
Contributor

@Nkmol Nkmol commented Apr 30, 2024

This PR fixes the boolean type definition of all models by transforming them into a pointer boolean. For now, I have only pushed one of the problematic models.

Underlying issue
Whenever a boolean value is false and it is not required, the omitempty serialization property will omit this property. In cases where an entity needs to be disabled through a false status, this is not the desired result. Instead, we always want to send true/false value, but omit when it is not explicitly set. Through a pointer, when the value is not defined, it will be set to nil and only then will be omitted from the API call.

Upstream
The issue is related to the generator used, and a very old issue is open for this: swagger-api/swagger-codegen#7391

I have sent an upstream Pull Request: swagger-api/swagger-codegen-generators#1275

As I do not expect this Pull Request to be merged any time soon (there has not been a Go update in 4 years), I added the same patch in this repo as a custom template. This template can be removed once upstream has been merged.


Related to DrFaust92/terraform-provider-bitbucket#191, and some other mentioned issues.
Once this has been merged, I will go through the related issues and add regression tests where it is needed.

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.

1 participant