diff --git a/src/core/index.js b/src/core/index.js index 109c70f9..1007d87c 100644 --- a/src/core/index.js +++ b/src/core/index.js @@ -177,15 +177,15 @@ export default function SwaggerUI(opts) { const configUrl = queryConfig.config || constructorConfig.configUrl - if (!configUrl || !system.specActions || !system.specActions.getConfigByUrl || system.specActions.getConfigByUrl && !system.specActions.getConfigByUrl({ - url: configUrl, - loadRemoteConfig: true, - requestInterceptor: constructorConfig.requestInterceptor, - responseInterceptor: constructorConfig.responseInterceptor, - }, downloadSpec)) { - return downloadSpec() + if (configUrl && system.specActions && system.specActions.getConfigByUrl) { + system.specActions.getConfigByUrl({ + url: configUrl, + loadRemoteConfig: true, + requestInterceptor: constructorConfig.requestInterceptor, + responseInterceptor: constructorConfig.responseInterceptor, + }, downloadSpec) } else { - system.specActions.getConfigByUrl(configUrl, downloadSpec) + return downloadSpec() } return system