-
Notifications
You must be signed in to change notification settings - Fork 22
Open
Description
This one might be a tricky one but very powerful.
Let's say I want to perform multiple checks on a value but only given certain conditions.
And let's say the conditions are based on the previous validation results.
For example:
Given the input myemail@gmail.com I want to get the domain of the email.
But I only want the domain if it's a valid email address and if the prefix has an odd amount of characters before the @ sign.
The caller of the API could implement this logic client side...
Or...
what if the API could do it for them?
So what if we could pass an API input like the following: (pseudocode below)
{
inputString: "myemail@gmail.com",
sequence: [
{
"run": "validateEmail"
},
{
"run": "characterCount",
"input": "previousValue" // this would pull the previous input value
"if": "previousResult" // would run only if the previous result evaluates to true
},
{
"run": "characterCount",
"input": "previousValue" // this would pull the previous input value
"if-equals": ["previousResult" % 2 == 0, "false"]
},
{
"run": "domainSuffix
"input": "previousValue",
"if-equals": "true
}
]
}
This could start as something simpler and evolve as needed. Basically it's allowing for batch calls with conditions.
Metadata
Metadata
Assignees
Labels
No labels