Skip to content

Commit

Permalink
feat(generate): allow for optional params
Browse files Browse the repository at this point in the history
BREAKING CHANGE: optional parameters are now marked as a pointer.
  • Loading branch information
rubenfonseca committed Feb 25, 2022
1 parent 962ea27 commit d9bfdff
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion generate/templates/globals.template
Expand Up @@ -14,7 +14,7 @@ type {{.StructName}} struct {
// {{$name}} AWS CloudFormation Property
// Required: false
// See: {{$property.Documentation}}
{{$prop_name}} {{if (or ($property.IsPolymorphic) ($property.IsCustomType) )}}*{{$iname}}.{{end}}{{$property.GoType $.ResourceName $.Basename $name}} `json:"{{$name}}{{if (not (and ($property.IsNumeric) ($property.Required)))}},omitempty{{end}}"`
{{$prop_name}} {{if (or ($property.IsPolymorphic) ($property.IsCustomType) )}}*{{$iname}}.{{else}}*{{end}}{{$property.GoType $.ResourceName $.Basename $name}} `json:"{{$name}}{{if (not ($property.Required))}},omitempty{{end}}"`
{{end}}
}

Expand Down
2 changes: 1 addition & 1 deletion generate/templates/resource.template
Expand Up @@ -25,7 +25,7 @@ type {{.StructName}} struct {
// {{$name}} AWS CloudFormation Property
// Required: {{$property.Required}}
// See: {{$property.Documentation}}
{{$prop_name}} {{if (or ($property.IsPolymorphic) ($property.IsCustomType) )}}*{{end}}{{$property.GoType $.Name $.Basename $name}} `json:"{{$name}}{{if (not (and ($property.IsNumeric) ($property.Required)))}},omitempty{{end}}"`
{{$prop_name}} {{if (or ($property.IsPolymorphic) ($property.IsCustomType) (not ($property.Required)) )}}*{{end}}{{$property.GoType $.Name $.Basename $name}} `json:"{{$name}}{{if (not ($property.Required))}},omitempty{{end}}"`
{{end}}
{{if .HasUpdatePolicy }}// AWSCloudFormationUpdatePolicy represents a CloudFormation UpdatePolicy
AWSCloudFormationUpdatePolicy *policies.UpdatePolicy `json:"-"`{{ end }}
Expand Down

0 comments on commit d9bfdff

Please sign in to comment.