integrate parameters to support legacy tasks with parameters (#3567)
This commit is contained in:
@@ -2,9 +2,6 @@ import Dagre from "@dagrejs/dagre";
|
||||
import type { Node } from "@xyflow/react";
|
||||
import { Edge } from "@xyflow/react";
|
||||
import { nanoid } from "nanoid";
|
||||
|
||||
import { TSON } from "@/util/tson";
|
||||
|
||||
import {
|
||||
WorkflowBlockType,
|
||||
WorkflowBlockTypes,
|
||||
@@ -2191,12 +2188,10 @@ function getWorkflowErrors(nodes: Array<AppNode>): Array<string> {
|
||||
}
|
||||
// Validate Task data schema JSON when enabled (value different from "null")
|
||||
if (node.data.dataSchema && node.data.dataSchema !== "null") {
|
||||
const result = TSON.parse(node.data.dataSchema);
|
||||
|
||||
if (!result.success) {
|
||||
errors.push(
|
||||
`${node.data.label}: Data schema has invalid templated JSON: ${result.error ?? "-"}`,
|
||||
);
|
||||
try {
|
||||
JSON.parse(node.data.dataSchema);
|
||||
} catch {
|
||||
errors.push(`${node.data.label}: Data schema is not valid JSON.`);
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -2232,12 +2227,10 @@ function getWorkflowErrors(nodes: Array<AppNode>): Array<string> {
|
||||
}
|
||||
// Validate Extraction data schema JSON when enabled (value different from "null")
|
||||
if (node.data.dataSchema && node.data.dataSchema !== "null") {
|
||||
const result = TSON.parse(node.data.dataSchema);
|
||||
|
||||
if (!result.success) {
|
||||
errors.push(
|
||||
`${node.data.label}: Data schema has invalid templated JSON: ${result.error ?? "-"}`,
|
||||
);
|
||||
try {
|
||||
JSON.parse(node.data.dataSchema);
|
||||
} catch {
|
||||
errors.push(`${node.data.label}: Data schema is not valid JSON.`);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user