Closed
Description
Q&A (please complete the following information)
- Method of installation: npm
- Swagger-UI version: 3.18.x
Content & configuration
Swagger-UI configuration options:
import SwaggerUI from 'swagger-ui'
import SwaggerUIStandalonePreset from 'swagger-ui/dist/swagger-ui-standalone-preset'
window.onload = function() {
const ui = SwaggerUI({
configUrl: '/api/swagger-config.json',
dom_id: '#swagger-ui',
presets: [
SwaggerUI.presets.apis,
SwaggerUIStandalonePreset
],
plugins: [
SwaggerUI.plugins.DownloadUrl
],
layout: 'StandaloneLayout',
filter: true,
requestInterceptor: function(request) {
// handle CSRF
return request;
},
responseInterceptor: function (response) {
// handle json prefix
return response
}
})
})
window.ui = ui
And my swagger-config.json file:
{
"url": "/swagger-portal.json",
"filter": true,
"deepLinking": true,
"validatorUrl": null
}
How can we help?
My swagger config file (define in configUrl parameter) is downloaded two times (illustrated in the screenshot below).
From the code src/core/index.js and src/core/plugins/configs/spec-actions.js it's normal.
However I think it might be more efficient to check if the requests parameter exists before calling the getConfigByUrl method in the if condition to avoid double downloading.
Maybe I missed something?