diff --git a/public/pages/workflow_detail/workflow_inputs/ingest_inputs/source_data.tsx b/public/pages/workflow_detail/workflow_inputs/ingest_inputs/source_data.tsx index d6ba2a8e..2e8a1937 100644 --- a/public/pages/workflow_detail/workflow_inputs/ingest_inputs/source_data.tsx +++ b/public/pages/workflow_detail/workflow_inputs/ingest_inputs/source_data.tsx @@ -65,6 +65,7 @@ export function SourceData(props: SourceDataProps) { {}} diff --git a/public/pages/workflow_detail/workflow_inputs/processor_inputs/input_transform_modal.tsx b/public/pages/workflow_detail/workflow_inputs/processor_inputs/input_transform_modal.tsx index 7a45c1cc..670d22be 100644 --- a/public/pages/workflow_detail/workflow_inputs/processor_inputs/input_transform_modal.tsx +++ b/public/pages/workflow_detail/workflow_inputs/processor_inputs/input_transform_modal.tsx @@ -49,8 +49,8 @@ export function InputTransformModal(props: InputTransformModalProps) { const { values } = useFormikContext(); // source input / transformed output state - const [sourceInput, setSourceInput] = useState('{}'); - const [transformedOutput, setTransformedOutput] = useState('{}'); + const [sourceInput, setSourceInput] = useState('[]'); + const [transformedOutput, setTransformedOutput] = useState('[]'); return ( diff --git a/public/utils/config_to_form_utils.ts b/public/utils/config_to_form_utils.ts index fa6a3dc3..fb3bee5f 100644 --- a/public/utils/config_to_form_utils.ts +++ b/public/utils/config_to_form_utils.ts @@ -42,7 +42,7 @@ function ingestConfigToFormik( let ingestFormikValues = {} as FormikValues; if (ingestConfig) { ingestFormikValues['enabled'] = ingestConfig.enabled; - ingestFormikValues['docs'] = ingestDocs || getInitialValue('json'); + ingestFormikValues['docs'] = ingestDocs || '[]'; ingestFormikValues['enrich'] = processorsConfigToFormik( ingestConfig.enrich ); diff --git a/public/utils/config_to_schema_utils.ts b/public/utils/config_to_schema_utils.ts index 72d8055a..7f4a2a39 100644 --- a/public/utils/config_to_schema_utils.ts +++ b/public/utils/config_to_schema_utils.ts @@ -108,10 +108,10 @@ function getFieldSchema(fieldType: ConfigFieldType): Schema { break; } case 'json': { - baseSchema = yup.string().test('json', 'Invalid JSON', (value) => { + baseSchema = yup.string().test('json', 'Invalid JSON array', (value) => { try { // @ts-ignore - JSON.parse(value); + return Array.isArray(JSON.parse(value)); return true; } catch (error) { return false;