Skip to content

Commit 33ad849

Browse files
committed
support lowercase first letter properties
1 parent f7249d1 commit 33ad849

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

cfn/handler/request_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@ func TestUnmarshal(t *testing.T) {
1616
type Model struct {
1717
Name *string
1818
Version *float64
19-
Detail *Detail
19+
Detail *Detail `json:"detail,omitempty"`
2020
}
2121

2222
req := Request{
2323
LogicalResourceID: "foo",
24-
previousResourcePropertiesBody: []byte(`{"Name":"bar","Version":"0.1","Detail":{"Build":"57","IsProduction":"false"}}`),
25-
resourcePropertiesBody: []byte(`{"Name":"baz","Version":"2.3","Detail":{"Build":"69","IsProduction":"true"}}`),
24+
previousResourcePropertiesBody: []byte(`{"Name":"bar","Version":"0.1","detail":{"Build":"57","IsProduction":"false"}}`),
25+
resourcePropertiesBody: []byte(`{"Name":"baz","Version":"2.3","detail":{"Build":"69","IsProduction":"true"}}`),
2626
}
2727

2828
expectedPrevious := Model{

python/rpdk/go/templates/types.go.tple

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ package resource
1212
// {{model_name}} is autogenerated from the json schema
1313
type {{model_name}} struct {
1414
{% for name, type in properties.items() %}
15-
{{ name|uppercase_first_letter }} {{ type|translate_type }} `json:",omitempty"`
15+
{{ name|uppercase_first_letter }} {{ type|translate_type }} `json:"{{name}},omitempty"`
1616
{% endfor %}
1717
}
1818

0 commit comments

Comments
 (0)