You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When the input type might be optional/undefined, the specific syntax required seems to be oddly specific (as per the documentation, it seems it only copes with the conditional test being not equal to the expected input type.
I've tried alternates such as:
Truthy: if (!input.property) {...
Test against undefined: if (input.property === undefined) {...
If the documented syntax isn't used, I get the error:
An error occurred while executing the state 'If (input.property === ...' (entered at the event id #4). Invalid path '$.vars.property': The choice state's condition path references an invalid value.
A test against the type seems too narrow, but I suspect its triggered by the input type being specified as a union including undefined, whether as an optional or specifically with undefined:
In either case, it seems that it should recognise the presence of the property.
I can think of cases where the step function is consuming multiple sources, and wanting to branch on the presence of a discriminator, which might be a property with a certain value, type, or union of mutually exclusive types.
The text was updated successfully, but these errors were encountered:
Docs: https://github.com/Stedi/ts2asl/blob/main/examples/input-validation.md#check-argument-type-provide-default
When the input type might be optional/undefined, the specific syntax required seems to be oddly specific (as per the documentation, it seems it only copes with the conditional test being not equal to the expected input type.
I've tried alternates such as:
if (!input.property) {...
if (input.property === undefined) {...
If the documented syntax isn't used, I get the error:
A test against the type seems too narrow, but I suspect its triggered by the input type being specified as a union including undefined, whether as an optional or specifically with undefined:
In either case, it seems that it should recognise the presence of the property.
I can think of cases where the step function is consuming multiple sources, and wanting to branch on the presence of a discriminator, which might be a property with a certain value, type, or union of mutually exclusive types.
The text was updated successfully, but these errors were encountered: