Closed shrsr closed 3 weeks ago
Hey there @shrsr 👋🏻, thanks for reporting the issue.
I don't think we created a GH issue for it, but I think the original plan after hashicorp/terraform-plugin-framework#894 was to implement the new function parameter validators for all the appropriate terraform-plugin-framework-validators
implementations.
I'm going to move this GH issue to the validators repo as our intention is to implement that new interface and support parameter-based validation for all the type packages (stringvalidator
, int64validator
, etc.)
@austinvalle Thank you for the reply. Will the above mentioned snippet in the docs still be present because it doesn't currently work?
I think we'd opt to just fix the root issue of the validation implementation not being finished (this issue), which when released would make the documentation valid. Rather than adjusting the docs, fixing this issue, then re-adjusting the docs back. Additionally, our documentation releases are linked to Go module releases and we don't have any upcoming terraform-plugin-framework
releases to link to ATM.
Thanks!
Most of the validators have been updated to support function validators with the latest release v0.14.0
.
There are some remaining ones like All
/Any
that can be tracked in #239
Module version
The following snippet in the documentation https://github.com/hashicorp/terraform-plugin-framework/blob/v1.10.0/website/docs/plugin/framework/validation.mdx under the section Parameter Validation doesn't work as expected.
Actual Behavior
Error Message: cannot use stringvalidator.LengthBetween() (value of type validator.String) as function.StringParameterValidator value in array or slice literal: validator.String does not implement function.StringParameterValidator (missing method ValidateParameterString)
Additionally, I would like to know if there are any plans to support functions under stringvalidator in the function.StringParameter in the future?