Skip to content

Commit

Permalink
fix(validation): pipelineFunctions (#517)
Browse files Browse the repository at this point in the history
  • Loading branch information
bboure committed Jul 8, 2022
1 parent 2e2eb34 commit 3b7022d
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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"
`;

Expand Down
1 change: 1 addition & 0 deletions src/__tests__/validation/pipelineFunctions.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ describe('Basic', () => {
request: 'request.vtl',
response: 'response.vtl',
},
function4: 'ds1',
},
] as Record<string, FunctionConfigInput>[],
},
Expand Down
1 change: 0 additions & 1 deletion src/resources/SyncConfig.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { O } from 'ts-toolbelt';
import { PipelineFunctionConfig, ResolverConfig } from '../types/plugin';
import { Api } from './Api';

Expand Down
10 changes: 2 additions & 8 deletions src/validation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
},
},
],
Expand Down

0 comments on commit 3b7022d

Please sign in to comment.