This is an automated email from the ASF dual-hosted git repository.

zihaoxiang pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/dolphinscheduler.git


The following commit(s) were added to refs/heads/dev by this push:
     new 0a28d33fc0 [Improvement-17749][UI][DATAX] Improvement datax json 
parameter validate (#17750)
0a28d33fc0 is described below

commit 0a28d33fc0164a664ed6d3a5b0319427ce592341
Author: 小可耐 <[email protected]>
AuthorDate: Fri Nov 28 15:03:45 2025 +0800

    [Improvement-17749][UI][DATAX] Improvement datax json parameter validate 
(#17750)
---
 .../projects/task/components/node/fields/use-datax.ts      | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git 
a/dolphinscheduler-ui/src/views/projects/task/components/node/fields/use-datax.ts
 
b/dolphinscheduler-ui/src/views/projects/task/components/node/fields/use-datax.ts
index 1c67019e18..b390d8891a 100644
--- 
a/dolphinscheduler-ui/src/views/projects/task/components/node/fields/use-datax.ts
+++ 
b/dolphinscheduler-ui/src/views/projects/task/components/node/fields/use-datax.ts
@@ -18,6 +18,7 @@ import { ref, onMounted, watch } from 'vue'
 import { useI18n } from 'vue-i18n'
 import { useCustomParams, useDatasource, useResources } from '.'
 import type { IJsonItem } from '../types'
+import utils from '@/utils'
 
 export function useDataX(model: { [field: string]: any }): IJsonItem[] {
   const { t } = useI18n()
@@ -175,7 +176,18 @@ export function useDataX(model: { [field: string]: any }): 
IJsonItem[] {
       validate: {
         trigger: ['input', 'trigger'],
         required: true,
-        message: t('project.node.sql_empty_tips')
+        validator() {
+          if (
+            model.json === '' ||
+            model.json === undefined ||
+            model.json === null
+          ) {
+            return new Error(t('project.node.sql_empty_tips'))
+          }
+          if (!utils.isJson(model.json)) {
+            return new Error(t('project.node.json_format_tips'))
+          }
+        }
       }
     },
     useResources(useResourcesSpan),

Reply via email to