Skip to content

Commit 3b7022d

Browse files
authored
fix(validation): pipelineFunctions (#517)
1 parent 2e2eb34 commit 3b7022d

File tree

4 files changed

+4
-10
lines changed

4 files changed

+4
-10
lines changed

src/__tests__/validation/__snapshots__/pipelineFunctions.test.ts.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ exports[`Basic Invalid should validate: Invalid embedded datasource 1`] = `
1515
`;
1616

1717
exports[`Basic Invalid should validate: Invalid inline datasource 1`] = `
18-
"/pipelineFunctions/function1: must be object
18+
"/pipelineFunctions/function1: must be a string or an object
1919
/pipelineFunctions: contains invalid pipeline function definitions"
2020
`;
2121

src/__tests__/validation/pipelineFunctions.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ describe('Basic', () => {
4949
request: 'request.vtl',
5050
response: 'response.vtl',
5151
},
52+
function4: 'ds1',
5253
},
5354
] as Record<string, FunctionConfigInput>[],
5455
},

src/resources/SyncConfig.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { O } from 'ts-toolbelt';
21
import { PipelineFunctionConfig, ResolverConfig } from '../types/plugin';
32
import { Api } from './Api';
43

src/validation.ts

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -802,18 +802,12 @@ export const appSyncSchema = {
802802
pipelineFunctions: {
803803
oneOf: [
804804
{
805-
type: 'object',
806-
additionalProperties: {
807-
$ref: '#/definitions/pipelineFunctionConfig',
808-
},
805+
$ref: '#/definitions/pipelineFunctionConfigMap',
809806
},
810807
{
811808
type: 'array',
812809
items: {
813-
type: 'object',
814-
additionalProperties: {
815-
$ref: '#/definitions/pipelineFunctionConfig',
816-
},
810+
$ref: '#/definitions/pipelineFunctionConfigMap',
817811
},
818812
},
819813
],

0 commit comments

Comments
 (0)