-
Notifications
You must be signed in to change notification settings - Fork 167
Description
What would you like to be added:
There are really 3 concerns at hand in this issue:
- In situations where a field expects an expression (ie; actionDataFilter.result) is it necessary for the expression text to be surrounded by
${}. - In situations where the expected type of result of an expression is unknown, a user should be able to clearly indicate whether they expect string interpolation or json data to be returned (for example; specifying arguments to a function invocation)
- Some data-filter fields return data, and others return paths where other data should be merged (actionDataFilter.result vs. actionDataFilter.toStateData). These different concepts should be clarified, and in particular the "path" type fields should have some examples talking about the complex ways in which it's expected to work.
Fix all the places where an 'expression' is used to specify a location in a json structure where data should be inserted/merged.
Why is this needed:
Regarding string interpolation vs. workflow expressions, if both use-cases are basically a jq expression in a string surrounded by ${}, then there are situations where it's unclear which is intended. Imho, for fields where the purpose of the field is to accept an expression, the DSL should not require the ${}, and that ${} should be reserved to indicate string interpolation is expected.
Recent changes to actionDataFilter confusingly use 'expression' for 'toStateData' attribute, and there are presumably many other places in the spec that also need to be fixed.
Expressions (denoted by a string with ${...}) typically extract or transform some values. On the other hand, a property like actionDataFilter.toStateData is expecting the user to indicate a 'path' or location in the state data where the results should be inserted/merged. It doesn't make sense to call this an 'expression', or to have the user style it like an expression. The proposal is to fix the descriptions, and remove the surrounding ${} from all of the examples.