Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(config/validation): no jsonata checking for customDatasources #31878

Merged
merged 1 commit into from
Oct 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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