Validate output of functions against type #37430
Labels
enhancement
New value added to drive a business result
Feature:Canvas
impact:low
Addressing this issue will have a low level of impact on the quality/strength of our product.
loe:small
Small Level of Effort
Team:Presentation
Presentation Team for Dashboard, Input Controls, and Canvas
Describe the feature:
Function definitions specify a
type
, which informs the interpreter about what type of data the function will produce. However, the output when calling a function is never validated against that type.Canvas has type validation, which can be used in addition to a basic
getType
check, if we want to get fancy. But a simplegetType(output) === fnSpec.type
would suffice.Describe a specific use case for the feature:
This is mostly so that when users create custom functions, they can be sure that they thing they return is valid, and will work with other functions that handle that type.
This is going to be an issue with some existing functions in Canvas though, specifically the
filter
function, as noted in #37422The text was updated successfully, but these errors were encountered: