-
Notifications
You must be signed in to change notification settings - Fork 230
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
Add wrapper functions for validation helper without Diagnostics #534
Comments
Use the next major version of SDK. Remove usage of all deprecated functions. Only leave ValidateFunc for now since there are currently no wrappers for the existing validation helpers. See: hashicorp/terraform-plugin-sdk#534. Refactor "theme" in resource_selectel_vpc_project_v2 to use map of strings since map of resources is not possible anymore. See: hashicorp/terraform-plugin-sdk#338 Add internal mutexkv and hashcode implementations from v1 SDK. See: hashicorp/terraform-plugin-sdk#438
Use the next major version of SDK. Remove usage of all deprecated functions. Only leave ValidateFunc for now since there are currently no wrappers for the existing validation helpers. See: hashicorp/terraform-plugin-sdk#534. Refactor "theme" in resource_selectel_vpc_project_v2 to use map of strings since map of resources is not possible anymore. See: hashicorp/terraform-plugin-sdk#338 Add internal mutexkv and hashcode implementations from v1 SDK. See: hashicorp/terraform-plugin-sdk#438
* Upgrade Terraform SDK to v2.0.1 Use the next major version of SDK. Remove usage of all deprecated functions. Only leave ValidateFunc for now since there are currently no wrappers for the existing validation helpers. See: hashicorp/terraform-plugin-sdk#534. Refactor "theme" in resource_selectel_vpc_project_v2 to use map of strings since map of resources is not possible anymore. See: hashicorp/terraform-plugin-sdk#338 Add internal mutexkv and hashcode implementations from v1 SDK. See: hashicorp/terraform-plugin-sdk#438 * Add TestFlattenVPCProjectV2Theme unit test Add test for flattenVPCProjectV2Theme function.
Maybe something like this:
Would this sort of curry work?
|
Similarly, the |
This was released with version 2.4.0 of the SDK. |
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. |
SDK version
Use-cases
The field
ValidateFunc
of Schema type is deprecated since v2. Now we should useValidateDiagFunc
, but all validation helper (except map helper) useschema.SchemaValidateFunc
and notschema.SchemaValidateDiagFunc
.Attempted Solutions
What we tried to do in our plugin was create function that wraps existing validation helpers and returns
diag.Diagnostics
instead of errors.Proposal
To help with migration from v1 to v2 we could create wrapper functions for every validation helper that return
schema.SchemaValidateDiagFunc
instead ofschema.SchemaValidateFunc
.References
The text was updated successfully, but these errors were encountered: