From 8419e7f42af2cc4275f7ccc056f50ccd3f2a08e0 Mon Sep 17 00:00:00 2001 From: Rhys Arkins Date: Wed, 9 Oct 2024 21:16:38 +0200 Subject: [PATCH] fix(config/validation): no jsonata checking for customDatasources --- lib/config/validation.spec.ts | 4 ---- lib/config/validation.ts | 12 +----------- 2 files changed, 1 insertion(+), 15 deletions(-) diff --git a/lib/config/validation.spec.ts b/lib/config/validation.spec.ts index 914d761b825772..a49e75c0de319e 100644 --- a/lib/config/validation.spec.ts +++ b/lib/config/validation.spec.ts @@ -329,10 +329,6 @@ describe('config/validation', () => { } as any; const { errors } = await configValidation.validateConfig('repo', config); expect(errors).toMatchObject([ - { - message: - 'Invalid JSONata expression for customDatasources: Expected "]" before end of expression', - }, { message: 'Invalid `customDatasources.defaultRegistryUrlTemplate` configuration: is a string', diff --git a/lib/config/validation.ts b/lib/config/validation.ts index 18ce6a31ca4a49..d139cb42c10436 100644 --- a/lib/config/validation.ts +++ b/lib/config/validation.ts @@ -747,17 +747,7 @@ export async function validateConfig( message: `Invalid \`${currentPath}.${subKey}\` configuration: key is not allowed`, }); } else if (subKey === 'transformTemplates') { - if (is.array(subValue, is.string)) { - for (const expression of subValue) { - const res = getExpression(expression); - if (res instanceof Error) { - errors.push({ - topic: 'Configuration Error', - message: `Invalid JSONata expression for ${currentPath}: ${res.message}`, - }); - } - } - } else { + if (!is.array(subValue, is.string)) { errors.push({ topic: 'Configuration Error', message: `Invalid \`${currentPath}.${subKey}\` configuration: is not an array of string`,