From d30b3a9ba156f02216d188d1b753249b1e0042f6 Mon Sep 17 00:00:00 2001 From: shockey Date: Thu, 18 May 2017 23:33:12 -0700 Subject: [PATCH 1/2] Add custom namespace to config whitelist --- src/core/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/index.js b/src/core/index.js index 6d77f6b0..6e737768 100644 --- a/src/core/index.js +++ b/src/core/index.js @@ -8,7 +8,7 @@ import { parseSeach, filterConfigs } from "core/utils" const CONFIGS = [ "url", "spec", "validatorUrl", "onComplete", "onFailure", "authorizations", "docExpansion", "apisSorter", "operationsSorter", "supportedSubmitMethods", "highlightSizeThreshold", "dom_id", - "defaultModelRendering", "oauth2RedirectUrl", "showRequestHeaders" ] + "defaultModelRendering", "oauth2RedirectUrl", "showRequestHeaders", "custom" ] // eslint-disable-next-line no-undef const { GIT_DIRTY, GIT_COMMIT, PACKAGE_VERSION } = buildInfo From b530ac8593c292a24f15d015b5246d517428854f Mon Sep 17 00:00:00 2001 From: shockey Date: Thu, 18 May 2017 23:35:02 -0700 Subject: [PATCH 2/2] Default value for custom key --- src/core/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/index.js b/src/core/index.js index 6e737768..727b56ad 100644 --- a/src/core/index.js +++ b/src/core/index.js @@ -25,8 +25,8 @@ module.exports = function SwaggerUI(opts) { url: "", layout: "BaseLayout", validatorUrl: "https://online.swagger.io/validator", - configs: { - }, + configs: {}, + custom: {}, // Initial set of plugins ( TODO rename this, or refactor - we don't need presets _and_ plugins. Its just there for performance. // Instead, we can compile the first plugin ( it can be a collection of plugins ), then batch the rest.