-
Notifications
You must be signed in to change notification settings - Fork 94
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 parameter-based provider-defined function validation #971
Conversation
…eter-type-validation
…cError and add switch to handle validation.ValidateableParameter interface
…lidateableParameter interface
…validation.ValidateableParameter interface
…o avoid import cycle
…eter-type-validation
…idateableAttribute assertions
…dateableAttribute assertions
…age to `function` package.
…alueWithValidateAttributeWarning
…dle ValidateableAttribute assertions
…omFloat(), FromBigFloat(), and FromBigInt() functions to handle ValidateableAttribute assertions
… handle ValidateableAttribute assertions
…andle ValidateableAttribute assertions
…handle ValidateableAttribute assertions
…eter-type-validation
…nction parameters in ArgumentsData() function
Co-authored-by: Austin Valle <austinvalle@gmail.com>
…/pdf-parameter-type-validation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🚀
Nice job!
…dateParameter<Type>()`
# Conflicts: # attr/xattr/attribute.go # internal/fromproto5/arguments_data.go # internal/fromproto5/arguments_data_test.go # internal/fromproto6/arguments_data.go # internal/fromproto6/arguments_data_test.go # website/docs/plugin/framework/validation.mdx
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, just two minor comments
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great test coverage here! 🥳
Co-authored-by: Austin Valle <austinvalle@gmail.com>
…eMust` functions
…ation' into SBGoods/pdf-parameter-type-validation
I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active contributions. |
Closes: #894
Background
Provider-defined functions can accept parameters, or arguments as input. There is an opportunity to provide validation of such parameters in an analogous manner to the validation of values supplied in configuration for attributes, by implementing parameter-based and type-based validation for provider-defined function parameters.
This PR is concerned with the addition of parameter-based validation, which enables provider developers to define custom validators on framework-provided type parameters or on custom parameters.
<Type>Validator
InterfacesThis PR adds various
<Type>Validator
interfaces for custom validators to implement for parameter-based validationParameterWith<Type>Validators
InterfacesThis PR adds various
ParameterWith<Type>Validators
interfaces for custom parameter types to implement to enable parameter-based validation