diff --git a/cfn/handler/request_test.go b/cfn/handler/request_test.go index f7728fd2..4c10ffb2 100644 --- a/cfn/handler/request_test.go +++ b/cfn/handler/request_test.go @@ -16,13 +16,13 @@ func TestUnmarshal(t *testing.T) { type Model struct { Name *string Version *float64 - Detail *Detail + Detail *Detail `json:"detail,omitempty"` } req := Request{ LogicalResourceID: "foo", - previousResourcePropertiesBody: []byte(`{"Name":"bar","Version":"0.1","Detail":{"Build":"57","IsProduction":"false"}}`), - resourcePropertiesBody: []byte(`{"Name":"baz","Version":"2.3","Detail":{"Build":"69","IsProduction":"true"}}`), + previousResourcePropertiesBody: []byte(`{"Name":"bar","Version":"0.1","detail":{"Build":"57","IsProduction":"false"}}`), + resourcePropertiesBody: []byte(`{"Name":"baz","Version":"2.3","detail":{"Build":"69","IsProduction":"true"}}`), } expectedPrevious := Model{ diff --git a/python/rpdk/go/templates/types.go.tple b/python/rpdk/go/templates/types.go.tple index e54eac02..0f5f0f92 100644 --- a/python/rpdk/go/templates/types.go.tple +++ b/python/rpdk/go/templates/types.go.tple @@ -12,7 +12,7 @@ package resource // {{model_name}} is autogenerated from the json schema type {{model_name}} struct { {% for name, type in properties.items() %} - {{ name|uppercase_first_letter }} {{ type|translate_type }} `json:",omitempty"` + {{ name|uppercase_first_letter }} {{ type|translate_type }} `json:"{{name}},omitempty"` {% endfor %} }