feat(deps): integrate swagger-client@3.22.0 (#9202)

This commit is contained in:
Vladimír Gorej
2023-09-13 10:43:27 +02:00
committed by GitHub
parent 2c04153614
commit d89726a24b
6 changed files with 502 additions and 510 deletions

View File

@@ -153,7 +153,10 @@ export default function SwaggerUI(opts) {
},
spec: {
spec: "",
// support Relative References
url: constructorConfig.url
? new URL(constructorConfig.url, document.baseURI || location.href).toString()
: constructorConfig.url,
},
requestSnippets: constructorConfig.requestSnippets
}, constructorConfig.initialState)
@@ -190,6 +193,19 @@ export default function SwaggerUI(opts) {
let localConfig = system.specSelectors.getLocalConfig ? system.specSelectors.getLocalConfig() : {}
let mergedConfig = deepExtend({}, localConfig, constructorConfig, fetchedConfig || {}, queryConfig)
// support Relative References in `url` config option
if (mergedConfig.url) {
mergedConfig.url = new URL(mergedConfig.url, document.baseURI || location.href).toString()
}
// support Relative References in `urls` config option
if (Array.isArray(mergedConfig.urls)) {
mergedConfig.urls = mergedConfig.urls.map(({ url , ...rest}) => ({
url: new URL(url, document.baseURI || location.href).toString(),
...rest,
}))
}
// deep extend mangles domNode, we need to set it manually
if(domNode) {
mergedConfig.domNode = domNode