Within the terraform-plugin-codegen-framework, models are generated from the specification. Currently, it is possible for the specification to contain names that are duplicated across attributes and blocks. For instance, the following intermediate representation is currently permitted
{
{
"datasources": [
{
"name": "datasource",
"schema": {
"attributes": [
{
"name": "one",
}
],
"blocks": [
{
"name": "one",
This results in the generation of a valid schema with the following form:
datasourceDataSourceSchema = schema.Schema{
Attributes: map[string]schema.Attribute{
"one": /*...*/
},
Blocks: map[string]schema.Block{
"one": /*...*/
},
}
However, it also results in the generation of an invalid model with the following form:
type DatasourceModel struct {
One types.Bool `tfsdk:"one"`
One types.List `tfsdk:"one"`
}
Within the terraform-plugin-codegen-framework, models are generated from the specification. Currently, it is possible for the specification to contain names that are duplicated across attributes and blocks. For instance, the following intermediate representation is currently permitted
{ { "datasources": [ { "name": "datasource", "schema": { "attributes": [ { "name": "one", } ], "blocks": [ { "name": "one",This results in the generation of a valid schema with the following form:
However, it also results in the generation of an invalid model with the following form: