Skip to content

Conversation

Nkmol
Copy link

@Nkmol Nkmol commented Apr 30, 2024

Go boolean types can sometimes conflict with serialization when a boolean value is not required. In this case, a value false would not be sent as it triggers omitempty. Using a pointer type makes sure the value is only omitted when nil, and not when false.

Fixes swagger-api/swagger-codegen#7391

@Nkmol Nkmol force-pushed the fix-go-boolean-types branch from 528db9f to 4ad1a72 Compare May 17, 2024 06:46
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.

[Go] optional boolean properties set to false are omitted when encoded
1 participant