terraform-plugin-sdk
terraform-plugin-sdk copied to clipboard
Fix panic message to show correct unhandled type rather than the parent type
I was trying to model a block that had map[string][]string as it's schema, but the code was panicking with:
Unknown validation type: 6
Debugging, and it became clear that non-primitive types are not supported in the switch, but I was puzzled as to why it was reporting that a TypeMap was not a valid map value.
The switch is against valueType, so it makes sense (to me at least) that the panic should report that as the unknown validation type.
With this change, the code would report:
Unknown validation type: 7
Where 7 equates to TypeSet (aka. the string slice value of the map)
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.