You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Provider developers implementing a schema definition for a data source, resource, or provider can define attribute-based validators to define validation rules that should be ran against configuration values. It might be nice to offer the same for provider-defined function definitions, since each parameter should theoretically be able to do something similar. The main "challenge" here is that the attribute-based validator interfaces and implementations are named relatively towards schemas, e.g. in their package import naming.
Attempted Solutions
Manually implement value validation in provider-defined function logic (Run method), checking the value, adding any diagnostics, and returning early if necessary.
Proposal
Open to suggestions
Double check whether the existing validator interfaces are acceptable to also serve as interfaces for parameter-based validation.
Add Validators fields to function.Parameter implementations. Implement parameter-based validation in internal/fromproto5.ArgumentsData() and internal/fromproto6.ArgumentsData() by looping through the Validators.
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.
Module version
Use-cases
Provider developers implementing a schema definition for a data source, resource, or provider can define attribute-based validators to define validation rules that should be ran against configuration values. It might be nice to offer the same for provider-defined function definitions, since each parameter should theoretically be able to do something similar. The main "challenge" here is that the attribute-based validator interfaces and implementations are named relatively towards schemas, e.g. in their package import naming.
Attempted Solutions
Manually implement value validation in provider-defined function logic (
Run
method), checking the value, adding any diagnostics, and returning early if necessary.Proposal
Open to suggestions
Double check whether the existing validator interfaces are acceptable to also serve as interfaces for parameter-based validation.
Add
Validators
fields tofunction.Parameter
implementations. Implement parameter-based validation ininternal/fromproto5.ArgumentsData()
andinternal/fromproto6.ArgumentsData()
by looping through theValidators
.References
The text was updated successfully, but these errors were encountered: