Flow's untyped input defaults can lead to runtime errors #5590
Labels
area/backend
Needs backend code changes
bug
Something isn't working
kind/customer-request
Requested by one or more customers
Describe the issue
TL;DR flow's input defaults should be correctly typed.
Currently the flow's input
defaults
field is not typed - it is a simpleObject
. This can lead to unexpected runtime errors in situations when a wrongly typed default is effectively applied and avalidator
is defined.For example, a validated
STRING
input withdefaults
being an integer fails since the validator can not be applied on an integer:Execute the flow above using the API and omit the flow input completely - the execution fails on validation.
The same behavior can be demonstrated by the following unit test: mismatchedDefaults.patch
It feels like this issue should be easily solved by switching the
Input
sdefaults
attribute type fromObject
to the generic typeT
- Input.java L81. It enables JSON Schema generation for thedefaults
.However, it breaks at least the
TIME
input a bit - JSON Schema'stime
requires timezone. Also the value itself is not validated.Environment
The text was updated successfully, but these errors were encountered: