Skip to content

Commit

Permalink
Implement arn and type definition only in oneOf descriptions
Browse files Browse the repository at this point in the history
  • Loading branch information
fredericbarthelet committed Sep 14, 2020
1 parent 7766524 commit 3b17faf
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions lib/plugins/aws/package/compile/events/stream/index.js
Expand Up @@ -17,7 +17,8 @@ class AwsCompileStreamEvents {
{
type: 'object',
properties: {
arn: { $ref: '#/definitions/awsArn' },
// arn constraints are listed in oneOf property of this schema
arn: {},
type: { enum: ['dynamodb', 'kinesis'] },
batchSize: { type: 'integer', minimum: 1, maximum: 10000 },
parallelizationFactor: { type: 'integer', minimum: 1, maximum: 10 },
Expand All @@ -42,22 +43,23 @@ class AwsCompileStreamEvents {
{
type: 'object',
properties: {
arn: { $ref: '#/definitions/awsArn' },
// arn constraints are listed in oneOf property of this schema
arn: {},
type: { enum: ['sns', 'sqs'] },
},
additionalProperties: false,
required: ['arn'],
oneOf: [
{
properties: {
arn: { $ref: '#/definitions/awsCfFunction' },
},
required: ['type'],
required: ['arn', 'type'],
},
{
properties: {
arn: { $ref: '#/definitions/awsArnString' },
},
required: ['arn'],
},
],
},
Expand All @@ -69,18 +71,18 @@ class AwsCompileStreamEvents {
},
},
additionalProperties: false,
required: ['arn'],
oneOf: [
{
properties: {
arn: { $ref: '#/definitions/awsCfFunction' },
},
required: ['type'],
required: ['arn', 'type'],
},
{
properties: {
arn: { $ref: '#/definitions/awsArnString' },
},
required: ['arn'],
},
],
},
Expand Down

0 comments on commit 3b17faf

Please sign in to comment.