From 3b17faf1c4b1277a5fe36243a748f8cc1f8a1d3a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Barthelet?= Date: Mon, 14 Sep 2020 15:05:09 +0200 Subject: [PATCH] Implement arn and type definition only in oneOf descriptions --- .../aws/package/compile/events/stream/index.js | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/lib/plugins/aws/package/compile/events/stream/index.js b/lib/plugins/aws/package/compile/events/stream/index.js index 38db6250821..463d88be03b 100644 --- a/lib/plugins/aws/package/compile/events/stream/index.js +++ b/lib/plugins/aws/package/compile/events/stream/index.js @@ -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 }, @@ -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'], }, ], }, @@ -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'], }, ], },