cultureamp / cfparams

Wrangle parameters for AWS CloudFormation
MIT License
0 stars 0 forks source link

"accept-defaults" arg doesn't work with when "Default" is an empty string #4

Closed sdemontfort closed 6 years ago

sdemontfort commented 6 years ago

When a Cloudformation parameter's Default field is set to an empty string, the accept-defaults flag doesn't work. This is due to the fact that the ParsedParameterSpec struct's Default field defaults to an empty string when not defined, and the check for whether a default is defined is whether it's an empty string: https://github.com/cultureamp/cfparams/blob/187e3de7f6f76be489d2a77d2eabdde59ee81811/main.go#L112

I propose a fix by allowing the Default field to be a string pointer, which will default to null if empty. (https://stackoverflow.com/questions/31048557/assigning-null-to-json-fields-instead-of-empty-strings-in-golang)