PipedreamHQ / PipedreamHQ/pipedream
[FEATURE] Support additional validation for user props
- Dominant language
- JavaScript
- Stars
- 11.7k
- Forks
- 5.8k
- Avg merge
- 3d 10h
- Merged PRs (30d)
- 102
Description
**Is your feature request related to a problem? Please describe.**
Validating user props when setting them up would be very useful since we would detect any issues earlier and avoid deploying faulty components. So far we have certain validations like `type`, `min`, `max`, etc. but in some cases the validation logic can be more complex (e.g. validating a string against a regex), and it'd be nice to catch any errors when setting up those props instead of doing it during the deploy/activation phase
**Describe the solution you'd like**
A couple of solutions have been proposed:
- Specifying the accepted data format/type via additional JSON schemas. In this case, the validation could be implemented in the client and the validation logic be computed there.
- Speciyfing a method (or list of methods) that takes in the provided value and throws an exception or returns some message when the value does not pass the validation.
**Do you have a workaround?**
Right now, the workaround is to do the checks during the Activation phase (i.e. within the scope of the `activate()` hook)
**Comparable features in other tools?**
Zapier for example has validation when setting up a zap:

**Additional context**
Slack discussion thread: https://pipedream-users.slack.com/archives/CMN2V5EAF/p1619666621039700
Contributor guide
Assessment
This issue has not been assessed yet.