hashicorp / terraform-plugin-codegen-spec

Terraform Provider Code Generation Specification and Go Bindings
Mozilla Public License 2.0
7 stars 4 forks source link

spec: Nest ListType, MapType, and SetType ElementType as explicit object property #29

Closed bflad closed 1 year ago

bflad commented 1 year ago

Reference: https://github.com/hashicorp/terraform-plugin-codegen-spec/pull/26

For consistency with collection attribute types which use an explicit element_type object property and object types which use an explicit attribute_types property. An additional benefit is that it further distinguishes where a custom_type may apply.

Previous implementations:

{
            "name": "list_map_attribute",
            "list": {
              "computed_optional_required": "computed",
              "element_type": {
                "map": {
                  "string": {}
                }
              }
            }
          },

Are now defined as:

          {
            "name": "list_map_attribute",
            "list": {
              "computed_optional_required": "computed",
              "element_type": {
                "map": {
                  "element_type": {
                    "string": {}
                  }
                }
              }
            }
          },

The Go bindings and any consuming code do not require changes since Go implicitly required the ElementType field definition, even when it was using type embedding.

github-actions[bot] commented 3 months ago

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active contributions. If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.