Skip to content

Commit c47a93d

Browse files
committed
Upgrade Swagger UI to v3 (React inside)
1 parent e3c17c8 commit c47a93d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+189
-12564
lines changed

src/Bridge/Symfony/Bundle/Resources/public/init-swagger-ui.js

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,22 @@
1-
$(function () {
1+
window.onload = function() {
2+
const data = JSON.parse(document.getElementById('swagger-data').innerText);
3+
const ui = SwaggerUIBundle({
4+
spec: data.spec,
5+
dom_id: '#swagger-ui',
6+
validatorUrl: null,
7+
presets: [
8+
SwaggerUIBundle.presets.apis,
9+
SwaggerUIStandalonePreset
10+
],
11+
plugins: [
12+
SwaggerUIBundle.plugins.DownloadUrl
13+
],
14+
layout: "StandaloneLayout"
15+
});
16+
window.ui = ui
17+
};
18+
19+
/*$(function () {
220
var data = JSON.parse($('#swagger-data').html());
321
window.swaggerUi = new SwaggerUi({
422
url: data.url,
@@ -58,4 +76,4 @@ $(function () {
5876
console.log.apply(console, arguments);
5977
}
6078
}
61-
});
79+
});*/

0 commit comments

Comments
 (0)