Skip to content

Commit 6ecae65

Browse files
committed
Remove config filtering
1 parent febd5ff commit 6ecae65

File tree

2 files changed

+2
-41
lines changed

2 files changed

+2
-41
lines changed

src/core/index.js

Lines changed: 2 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -4,34 +4,7 @@ import System from "core/system"
44
import win from "core/window"
55
import ApisPreset from "core/presets/apis"
66
import * as AllPlugins from "core/plugins/all"
7-
import { parseSearch, filterConfigs } from "core/utils"
8-
9-
const CONFIGS = [
10-
"url",
11-
"urls",
12-
"urls.primaryName",
13-
"spec",
14-
"validatorUrl",
15-
"onComplete",
16-
"onFailure",
17-
"authorizations",
18-
"docExpansion",
19-
"tagsSorter",
20-
"maxDisplayedTags",
21-
"filter",
22-
"operationsSorter",
23-
"supportedSubmitMethods",
24-
"dom_id",
25-
"defaultModelRendering",
26-
"oauth2RedirectUrl",
27-
"showRequestHeaders",
28-
"custom",
29-
"modelPropertyMacro",
30-
"parameterMacro",
31-
"displayOperationId",
32-
"displayRequestDuration",
33-
"deepLinking",
34-
]
7+
import { parseSearch } from "core/utils"
358

369
// eslint-disable-next-line no-undef
3710
const { GIT_DIRTY, GIT_COMMIT, PACKAGE_VERSION, HOSTNAME, BUILD_TIME } = buildInfo
@@ -126,7 +99,7 @@ module.exports = function SwaggerUI(opts) {
12699

127100
let localConfig = system.specSelectors.getLocalConfig ? system.specSelectors.getLocalConfig() : {}
128101
let mergedConfig = deepExtend({}, localConfig, constructorConfig, fetchedConfig || {}, queryConfig)
129-
store.setConfigs(filterConfigs(mergedConfig, CONFIGS))
102+
store.setConfigs(mergedConfig)
130103

131104
if (fetchedConfig !== null) {
132105
if (!queryConfig.url && typeof mergedConfig.spec === "object" && Object.keys(mergedConfig.spec).length) {

src/core/utils.js

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -597,18 +597,6 @@ export const buildFormData = (data) => {
597597
return formArr.join("&")
598598
}
599599

600-
export const filterConfigs = (configs, allowed) => {
601-
let i, filteredConfigs = {}
602-
603-
for (i in configs) {
604-
if (allowed.indexOf(i) !== -1) {
605-
filteredConfigs[i] = configs[i]
606-
}
607-
}
608-
609-
return filteredConfigs
610-
}
611-
612600
// Is this really required as a helper? Perhaps. TODO: expose the system of presets.apis in docs, so we know what is supported
613601
export const shallowEqualKeys = (a,b, keys) => {
614602
return !!find(keys, (key) => {

0 commit comments

Comments
 (0)