2
2
<script >
3
3
window . onload = function ( ) {
4
4
// Build a system
5
- const ui = SwaggerUIBundle ( {
5
+ const config = {
6
6
url : "http://petstore.swagger.io/v2/swagger.json" ,
7
7
dom_id : '#swagger-ui' ,
8
8
presets : [
@@ -13,19 +13,24 @@ window.onload = function() {
13
13
SwaggerUIBundle . plugins . DownloadUrl
14
14
] ,
15
15
layout : "StandaloneLayout"
16
- } )
16
+ }
17
17
18
+ // begin customizations
19
+ config . url = "<%= @swagger_url %> " ;
20
+ config . validatorUrl = <%= @validator_url %> ;
21
+ config . oauth2RedirectUrl = "<%= oauth2_docs_path %> " ;
22
+ config . docExpansion = "<%= @doc_expansion %> " ;
23
+ // config.jsonEditor = "<%= @json_editor %> "; // not implemented
24
+ // l10n (translations) is not implemented.
25
+ // config.defaultModelRendering = "<%= @model_rendering %> ";
26
+ // config.showRequestHeaders = "<%= @request_headers %> ";
27
+ config . displayOperationId = false ;
28
+ // end customizations
29
+
30
+ const ui = SwaggerUIBundle ( config ) ;
18
31
window . ui = ui
19
32
20
- ui . url = "<%= @swagger_url %> " ;
21
- ui . validatorUrl = <%= @validator_url %> ;
22
- ui . oauth2RedirectUrl = "<%= oauth2_docs_path %> " ;
23
- ui . docExpansion = "<%= @doc_expansion %> " ;
24
- // ui.jsonEditor = "<%= @json_editor %> "; // not implemented
25
- // l10n (translations) is not implemented.
26
- // ui.defaultModelRendering = "<%= @model_rendering %> ";
27
- // ui.showRequestHeaders = "<%= @request_headers %> ";
28
- // ui.showOperationIds = false;
33
+ // begin customizations
29
34
ui . initOAuth ( {
30
35
clientId : "<%= @oauth_client_id %> " ,
31
36
clientSecret : "<%= @oauth_client_secret %> " ,
@@ -34,6 +39,7 @@ window.onload = function() {
34
39
scopeSeparator : "<%= @oauth_scope_separator %> " ,
35
40
additionalQueryStringParams : "<%= @oauth_query_string_params %> "
36
41
} ) ;
42
+ // end customizations
37
43
}
38
44
</ script >
39
45
<% end %>
0 commit comments