-
Notifications
You must be signed in to change notification settings - Fork 242
Description
SDK version
v1.4.0
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 and Error: "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 to ExactlyOneOf and AtLeastOneOf.