terraform-plugin-sdk icon indicating copy to clipboard operation
terraform-plugin-sdk copied to clipboard

Fix panic message to show correct unhandled type rather than the parent type

Open rm-hull opened this issue 3 years ago • 1 comments

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)

rm-hull avatar May 19 '22 14:05 rm-hull

CLA assistant check
All committers have signed the CLA.

hashicorp-cla avatar May 19 '22 14:05 hashicorp-cla

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.

github-actions[bot] avatar Sep 26 '22 02:09 github-actions[bot]