From 4008c6c8f17889f28b5d8d89af2823c6786675b8 Mon Sep 17 00:00:00 2001 From: Johannes Edelstam Date: Wed, 30 Sep 2020 15:09:41 +0200 Subject: [PATCH] Simplify schema validation --- .../compile/events/cloudFront/index.js | 34 ++++--------------- 1 file changed, 7 insertions(+), 27 deletions(-) diff --git a/lib/plugins/aws/package/compile/events/cloudFront/index.js b/lib/plugins/aws/package/compile/events/cloudFront/index.js index 6548ddeefbac..a6ce85702bbe 100644 --- a/lib/plugins/aws/package/compile/events/cloudFront/index.js +++ b/lib/plugins/aws/package/compile/events/cloudFront/index.js @@ -84,36 +84,16 @@ class AwsCompileCloudFrontEvents { type: 'object', properties: { AllowedMethods: { - oneOf: [ - { - uniqueItems: true, - minItems: 2, - items: { enum: ['GET', 'HEAD'] }, - }, - { - uniqueItems: true, - minItems: 3, - items: { enum: ['GET', 'HEAD', 'OPTIONS'] }, - }, - { - uniqueItems: true, - minItems: 7, - items: { enum: ['GET', 'HEAD', 'OPTIONS', 'PUT', 'PATCH', 'POST', 'DELETE'] }, - }, + enum: [ + ['GET', 'HEAD'], + ['GET', 'HEAD', 'OPTIONS'], + ['GET', 'HEAD', 'OPTIONS', 'PUT', 'PATCH', 'POST', 'DELETE'], ], }, CachedMethods: { - oneOf: [ - { - uniqueItems: true, - minItems: 2, - items: { enum: ['GET', 'HEAD'] }, - }, - { - uniqueItems: true, - minItems: 3, - items: { enum: ['GET', 'HEAD', 'OPTIONS'] }, - }, + enum: [ + ['GET', 'HEAD'], + ['GET', 'HEAD', 'OPTIONS'], ], }, ForwardedValues: {