From 6ecae65b5f512efe22f721e779412ba117fdc203 Mon Sep 17 00:00:00 2001 From: Kyle Shockey Date: Thu, 27 Jul 2017 13:01:44 -0700 Subject: [PATCH] Remove config filtering --- src/core/index.js | 31 ++----------------------------- src/core/utils.js | 12 ------------ 2 files changed, 2 insertions(+), 41 deletions(-) diff --git a/src/core/index.js b/src/core/index.js index 8a0d77b3f99..126cbc54c2f 100644 --- a/src/core/index.js +++ b/src/core/index.js @@ -4,34 +4,7 @@ import System from "core/system" import win from "core/window" import ApisPreset from "core/presets/apis" import * as AllPlugins from "core/plugins/all" -import { parseSearch, filterConfigs } from "core/utils" - -const CONFIGS = [ - "url", - "urls", - "urls.primaryName", - "spec", - "validatorUrl", - "onComplete", - "onFailure", - "authorizations", - "docExpansion", - "tagsSorter", - "maxDisplayedTags", - "filter", - "operationsSorter", - "supportedSubmitMethods", - "dom_id", - "defaultModelRendering", - "oauth2RedirectUrl", - "showRequestHeaders", - "custom", - "modelPropertyMacro", - "parameterMacro", - "displayOperationId", - "displayRequestDuration", - "deepLinking", - ] +import { parseSearch } from "core/utils" // eslint-disable-next-line no-undef const { GIT_DIRTY, GIT_COMMIT, PACKAGE_VERSION, HOSTNAME, BUILD_TIME } = buildInfo @@ -126,7 +99,7 @@ module.exports = function SwaggerUI(opts) { let localConfig = system.specSelectors.getLocalConfig ? system.specSelectors.getLocalConfig() : {} let mergedConfig = deepExtend({}, localConfig, constructorConfig, fetchedConfig || {}, queryConfig) - store.setConfigs(filterConfigs(mergedConfig, CONFIGS)) + store.setConfigs(mergedConfig) if (fetchedConfig !== null) { if (!queryConfig.url && typeof mergedConfig.spec === "object" && Object.keys(mergedConfig.spec).length) { diff --git a/src/core/utils.js b/src/core/utils.js index 466f479fb30..63736a37658 100644 --- a/src/core/utils.js +++ b/src/core/utils.js @@ -597,18 +597,6 @@ export const buildFormData = (data) => { return formArr.join("&") } -export const filterConfigs = (configs, allowed) => { - let i, filteredConfigs = {} - - for (i in configs) { - if (allowed.indexOf(i) !== -1) { - filteredConfigs[i] = configs[i] - } - } - - return filteredConfigs -} - // Is this really required as a helper? Perhaps. TODO: expose the system of presets.apis in docs, so we know what is supported export const shallowEqualKeys = (a,b, keys) => { return !!find(keys, (key) => {