elsa-core
elsa-core copied to clipboard
Error 400 when creating json array through wfl designer
Declaring a json array inside of the global variable definition window from the designer (
)
Will throw Error 400 when you try to save that.
Copy/cut everything and put it back inside will fix it.
I did a quick check and found the issue here: Source
onMonacoValueChanged(e: MonacoValueChangedArgs) {
// Don't try and parse JSON if it contains errors.
const errorCount = e.markers.filter(x => x.severity == MarkerSeverity.Error).length;
if (errorCount > 0)
return;
this.workflowDefinitionInternal.variables = e.value;
}
For some reason, after entering the closing bracket ], the editor still considers the syntanx invalid. It is required to provide another input (white space, comma, anything really) for the editor to consider the syntax valid and store it.
I'm not sure if this is a bug with Monaco editor itself or the way it is integrated into Elsa designer. It requires some further investigation.
Probably a fix would be to not rely on value changed event and instead update the value only when the user clicks save.
@sfmskywalker please let me know your thoughts.
Makes sense to rely on the value after the user clicks save 👍🏻