-
Notifications
You must be signed in to change notification settings - Fork 233
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve validation.StringInSlice error message #464
Labels
enhancement
New feature or request
Comments
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. |
Frankkkkk
added a commit
to Frankkkkk/terraform-plugin-sdk
that referenced
this issue
Aug 29, 2023
The validation function's error is ambiguous when dealing with slices containing spaces. For example: ``` expected role_name to be one of [Apache Spark Administrator Synapse Credential User Synapse Administrator] ``` By changing the format verb, the error becomes more user friendly: ``` expected role_name to be one of ["Apache Spark Administrator" "Synapse Credential User" "Synapse Administrator"] ``` This fixes hashicorp#464 Signed-off-by: Frank Villaro-Dixon <[email protected]>
Frankkkkk
added a commit
to Frankkkkk/terraform-plugin-sdk
that referenced
this issue
Aug 29, 2023
The validation function's error is ambiguous when dealing with slices containing spaces. For example: ``` expected role_name to be one of [Apache Spark Administrator Synapse Credential User Synapse Administrator] ``` By changing the format verb, the error becomes more user friendly: ``` expected role_name to be one of ["Apache Spark Administrator" "Synapse Credential User" "Synapse Administrator"] ``` This fixes hashicorp#464 Signed-off-by: Frank Villaro-Dixon <[email protected]>
Frankkkkk
added a commit
to Frankkkkk/terraform-plugin-sdk
that referenced
this issue
Aug 29, 2023
The validation function's error is ambiguous when dealing with slices containing spaces. For example: ``` expected role_name to be one of [Apache Spark Administrator Synapse Credential User Synapse Administrator] ``` By changing the format verb, the error becomes more user friendly: ``` expected role_name to be one of ["Apache Spark Administrator" "Synapse Credential User" "Synapse Administrator"] ``` This fixes hashicorp#464 Signed-off-by: Frank Villaro-Dixon <[email protected]>
bflad
pushed a commit
that referenced
this issue
Aug 29, 2023
The validation function's error is ambiguous when dealing with slices containing spaces. For example: ``` expected role_name to be one of [Apache Spark Administrator Synapse Credential User Synapse Administrator] ``` By changing the format verb, the error becomes more user friendly: ``` expected role_name to be one of ["Apache Spark Administrator" "Synapse Credential User" "Synapse Administrator"] ``` This fixes #464 Signed-off-by: Frank Villaro-Dixon <[email protected]>
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
SDK version
Use-cases
When using the
StringInSlice
SchemaValidateFunc with valid strings that contain white spaces.For example:
If the user inputs an invalid value the error message looks like
It is ambiguous whether "Base Policy" is a single phrase or two separate words.
Attempted Solutions
I've written my own version of
StringInSlice
that separates words by comma. So the error message instead looks likeProposal
By default,
StringInSlice
should separate valid values by comma in the error message. I would be happy to work on this as I've already done it once! 😄References
None.
The text was updated successfully, but these errors were encountered: