diff --git a/src/__tests__/validation/__snapshots__/pipelineFunctions.test.ts.snap b/src/__tests__/validation/__snapshots__/pipelineFunctions.test.ts.snap index 6b910f31..5a9c6ec8 100644 --- a/src/__tests__/validation/__snapshots__/pipelineFunctions.test.ts.snap +++ b/src/__tests__/validation/__snapshots__/pipelineFunctions.test.ts.snap @@ -15,7 +15,7 @@ exports[`Basic Invalid should validate: Invalid embedded datasource 1`] = ` `; exports[`Basic Invalid should validate: Invalid inline datasource 1`] = ` -"/pipelineFunctions/function1: must be object +"/pipelineFunctions/function1: must be a string or an object /pipelineFunctions: contains invalid pipeline function definitions" `; diff --git a/src/__tests__/validation/pipelineFunctions.test.ts b/src/__tests__/validation/pipelineFunctions.test.ts index 3f113d34..7341e10c 100644 --- a/src/__tests__/validation/pipelineFunctions.test.ts +++ b/src/__tests__/validation/pipelineFunctions.test.ts @@ -49,6 +49,7 @@ describe('Basic', () => { request: 'request.vtl', response: 'response.vtl', }, + function4: 'ds1', }, ] as Record[], }, diff --git a/src/resources/SyncConfig.ts b/src/resources/SyncConfig.ts index 172c465c..893d2485 100644 --- a/src/resources/SyncConfig.ts +++ b/src/resources/SyncConfig.ts @@ -1,4 +1,3 @@ -import { O } from 'ts-toolbelt'; import { PipelineFunctionConfig, ResolverConfig } from '../types/plugin'; import { Api } from './Api'; diff --git a/src/validation.ts b/src/validation.ts index b104781c..ec12c871 100644 --- a/src/validation.ts +++ b/src/validation.ts @@ -802,18 +802,12 @@ export const appSyncSchema = { pipelineFunctions: { oneOf: [ { - type: 'object', - additionalProperties: { - $ref: '#/definitions/pipelineFunctionConfig', - }, + $ref: '#/definitions/pipelineFunctionConfigMap', }, { type: 'array', items: { - type: 'object', - additionalProperties: { - $ref: '#/definitions/pipelineFunctionConfig', - }, + $ref: '#/definitions/pipelineFunctionConfigMap', }, }, ],