hashicorp / terraform-plugin-codegen-spec

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

Consider providing a way to fully specify custom type #21

Open bendbennett opened 1 year ago

bendbennett commented 1 year ago

Within the Generator there is currently no way to fully override custom types for lists, maps, objects and sets. For instance:

    case e.List != nil:
        if e.List.CustomType != nil {
            return fmt.Sprintf("%s{\nElemType: %s,\n}", e.List.CustomType.Type, GetElementType(e.List.ElementType))

We may need a way in the specification to ensure that developers can fully specify how this should be created as code since its not guaranteed that the custom type will be implemented with an ElemType field. Similarly with object types.