swagger-api / swagger-codegen-generators

Apache License 2.0
280 stars 418 forks source link

fix(go): make sure boolean types are created as pointer types #1275

Open Nkmol opened 2 months ago

Nkmol commented 2 months ago

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 https://github.com/swagger-api/swagger-codegen/issues/7391