Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions cfn/handler/request_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down
2 changes: 1 addition & 1 deletion python/rpdk/go/templates/types.go.tple
Original file line number Diff line number Diff line change
Expand Up @@ -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 %}
}

Expand Down