Skip to content

Commit

Permalink
fix(config/validation): no jsonata checking for customDatasources (#3…
Browse files Browse the repository at this point in the history
  • Loading branch information
rarkins authored Oct 9, 2024
1 parent f386f7e commit c619d15
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 15 deletions.
4 changes: 0 additions & 4 deletions lib/config/validation.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
12 changes: 1 addition & 11 deletions lib/config/validation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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`,
Expand Down

0 comments on commit c619d15

Please sign in to comment.