fix: nerf property access to better support Editor test harness

This commit is contained in:
Kyle Shockey
2018-06-11 22:49:30 -07:00
parent cdd3663647
commit daea0715d7
2 changed files with 8 additions and 2 deletions
+7 -1
View File
@@ -131,6 +131,9 @@ module.exports = function SwaggerUI(opts) {
var system = store.getSystem()
const downloadSpec = (fetchedConfig) => {
if(typeof constructorConfig !== "object") {
return system
}
let localConfig = system.specSelectors.getLocalConfig ? system.specSelectors.getLocalConfig() : {}
let mergedConfig = deepExtend({}, localConfig, constructorConfig, fetchedConfig || {}, queryConfig)
@@ -140,7 +143,10 @@ module.exports = function SwaggerUI(opts) {
}
store.setConfigs(mergedConfig)
system.configsActions.loaded()
if(system.configsActions) {
system.configsActions.loaded()
}
if (fetchedConfig !== null) {
if (!queryConfig.url && typeof mergedConfig.spec === "object" && Object.keys(mergedConfig.spec).length) {
+1 -1
View File
@@ -12,7 +12,7 @@ export const updateJsonSpec = (ori, {specActions}) => (...args) => {
// Trigger resolution of any path-level $refs.
const [json] = args
const pathItems = get(json, ["paths"])
const pathItems = get(json, ["paths"]) || {}
const pathItemKeys = Object.keys(pathItems)
pathItemKeys.forEach(k => {