From 6a7bc42fc502d5ca66ced0f2525f1d7b16d88ddf Mon Sep 17 00:00:00 2001 From: Alef Date: Fri, 20 Mar 2020 15:12:03 +0300 Subject: [PATCH] fix passing boolean value to showExtensions options via docker --- src/services/RedocNormalizedOptions.ts | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/services/RedocNormalizedOptions.ts b/src/services/RedocNormalizedOptions.ts index 282f4eb1d2..219ad28617 100644 --- a/src/services/RedocNormalizedOptions.ts +++ b/src/services/RedocNormalizedOptions.ts @@ -112,11 +112,18 @@ export class RedocNormalizedOptions { return true; } - if (typeof value === 'string') { - return value.split(',').map(ext => ext.trim()); + if (typeof value !== 'string') { + return value } - return value; + switch (value) { + case 'true': + return true + case 'false': + return false + default: + return value.split(',').map(ext => ext.trim()); + } } static normalizePayloadSampleIdx(value: RedocRawOptions['payloadSampleIdx']): number {