TT#74005 add print support to the swagger doc

Change-Id: Ia6a07e0d79504cedd57169114bdbf85be8dae7d4
changes/94/37194/3
Kirill Solomko 6 years ago
parent dcbcba18e0
commit 419af78d90

@ -102,24 +102,45 @@ function HideTopbarPlugin() {
window.onload = function() {
// Build a system
const ui = SwaggerUIBundle({
url: "/api?swagger=1",
dom_id: '#swagger-ui',
deepLinking: true,
presets: [
SwaggerUIBundle.presets.apis,
SwaggerUIStandalonePreset
],
plugins: [
SwaggerUIBundle.plugins.DownloadUrl,
HideTopbarPlugin
],
layout: "StandaloneLayout",
//layout: "BaseLayout",
docExpansion: "none",
defaultModelsExpandDepth: 0,
validatorUrl: null
})
if (window.matchMedia("print").matches) {
const ui = SwaggerUIBundle({
url: "/api?swagger=1",
dom_id: '#swagger-ui',
deepLinking: true,
presets: [
SwaggerUIBundle.presets.apis,
SwaggerUIStandalonePreset
],
plugins: [
SwaggerUIBundle.plugins.DownloadUrl,
HideTopbarPlugin
],
layout: "StandaloneLayout",
//layout: "BaseLayout",
docExpansion: "full",
defaultModelsExpandDepth: 0,
validatorUrl: null
})
} else {
const ui = SwaggerUIBundle({
url: "/api?swagger=1",
dom_id: '#swagger-ui',
deepLinking: true,
presets: [
SwaggerUIBundle.presets.apis,
SwaggerUIStandalonePreset
],
plugins: [
SwaggerUIBundle.plugins.DownloadUrl,
HideTopbarPlugin
],
layout: "StandaloneLayout",
//layout: "BaseLayout",
docExpansion: "none",
defaultModelsExpandDepth: 0,
validatorUrl: null
})
}
window.ui = ui
};

Before

Width:  |  Height:  |  Size: 4.4 KiB

After

Width:  |  Height:  |  Size: 4.9 KiB

Loading…
Cancel
Save