Consolidate ConflictsWith errors #286
Labels
enhancement
New feature or request
terraform-plugin-framework
Resolved in terraform-plugin-framework
upstream-terraform
SDK version
Use-cases
Have a single error message for two related ConflictsWith fields- see hashicorp/terraform-provider-google#5284.
Attempted Solutions
If two fields conflict with each other, we can get a single error message by only setting
ConflictsWith
on one of them, which works fine.However, if three fields (A, B, and C) conflict with each other, we would have to set
ConflictsWith
on at least two of them in order to cover all cases (setting it only on A would mean that a user could set B and C together in their config), which means that a user could end up with two error messages.Proposal
Consolidate error messages when possible. In the example in the related issue, instead of having both
Error: "name_prefix": conflicts with name
andError: "name": conflicts with name_prefix
, recognize that those two are the same and only return one of them. My guess is that we'd also want to do something similar toExactlyOneOf
andAtLeastOneOf
.References
hashicorp/terraform-provider-google#5284
The text was updated successfully, but these errors were encountered: