Skip to content

Commit

Permalink
Add associated external type to single nested block in ir.json and up…
Browse files Browse the repository at this point in the history
…date test data (#31)
  • Loading branch information
bendbennett committed Aug 7, 2023
1 parent 4fc770c commit 172887d
Show file tree
Hide file tree
Showing 4 changed files with 204 additions and 47 deletions.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

25 changes: 19 additions & 6 deletions internal/cmd/testdata/custom_and_external/ir.json
Original file line number Diff line number Diff line change
Expand Up @@ -200,12 +200,6 @@
{
"name": "single_nested_attribute_one",
"single_nested": {
"associated_external_type": {
"import": {
"path": "example.com/apisdk"
},
"type": "*apisdk.DataSourceProperty"
},
"attributes": [
{
"name": "bool_attribute",
Expand Down Expand Up @@ -417,6 +411,25 @@
}
]
}
},
{
"name": "single_nested_block_assoc_ext_type",
"single_nested": {
"associated_external_type": {
"import": {
"path": "example.com/apisdk"
},
"type": "*apisdk.Type"
},
"attributes": [
{
"name": "bool_attribute",
"bool": {
"computed_optional_required": "computed"
}
}
]
}
}
]
}
Expand Down
2 changes: 1 addition & 1 deletion internal/templates/model_object_to_from.gotmpl
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ if apiObject == nil {
return tfModel.ObjectNull(ctx), diags
}

{{- range $key, $value := .Attributes }}
{{range $key, $value := .Attributes }}
tfModel.{{$key}} = types.{{$value.from}}(apiObject.{{$key}})
{{- end}}

Expand Down

0 comments on commit 172887d

Please sign in to comment.