Skip to content
This repository was archived by the owner on May 4, 2019. It is now read-only.

Commit 2c431d7

Browse files
committed
Merge remote-tracking branch 'upstream/master' into JSONEditorMaster
Conflicts: dist/swagger-ui.js dist/swagger-ui.min.js src/main/javascript/view/OperationView.js src/main/less/screen.less
2 parents e051023 + 63f6ede commit 2c431d7

32 files changed

+435
-366
lines changed

.gitattributes

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
* text eol=lf
2-
2+
src/**/*.ttf binary
33
dist/**/*.js binary
4+
dist/**/*.ttf binary
45
dist/**/*.map binary
56
dist/**/*.eot binary
67
dist/**/*.svg binary

.gitignore

+3-1
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,6 @@ swagger-ui.sublime-workspace
1212
.idea
1313
.project
1414
node_modules/*
15-
/nbproject/private/
15+
/nbproject/private/
16+
dist/specs/
17+
test/specs/local/

.travis.yml

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
sudo: false
22
language: node_js
33
node_js:
4-
- '0.10'
5-
- '0.12'
4+
- '4.2'
65
install:
76
- export DISPLAY=:99.0
87
- sh -e /etc/init.d/xvfb start

README.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ This will start Swagger UI at `http://localhost:8080`.
6262
Once you open the Swagger UI, it will load the [Swagger Petstore](http://petstore.swagger.io/v2/swagger.json) service and show its APIs. You can enter your own server url and click explore to view the API.
6363

6464
### Customize
65-
You may choose to customize Swagger UI for your organization. Here is an overview of whats in its various directories:
65+
You may choose to customize Swagger UI for your organization. Here is an overview of what's in its various directories:
6666

6767
- dist: Contains a distribution which you can deploy on a server or load from your local machine.
6868
- dist/lang: The swagger localization
@@ -98,6 +98,7 @@ booleanValues | SwaggerUI renders boolean data types as a dropdown. By default i
9898
docExpansion | Controls how the API listing is displayed. It can be set to 'none' (default), 'list' (shows operations for each resource), or 'full' (fully expanded: shows operations and their details).
9999
apisSorter | Apply a sort to the API/tags list. It can be 'alpha' (sort by name) or a function (see Array.prototype.sort() to know how sort function works). Default is the order returned by the server unchanged.
100100
operationsSorter | Apply a sort to the operation list of each API. It can be 'alpha' (sort by paths alphanumerically), 'method' (sort by HTTP method) or a function (see Array.prototype.sort() to know how sort function works). Default is the order returned by the server unchanged.
101+
defaultModelRendering | Controls how models are shown when the API is first rendered. (The user can always switch the rendering for a given model by clicking the 'Model' and 'Model Schema' links.) It can be set to 'model' or 'schema', and the default is 'schema'.
101102
onComplete | This is a callback function parameter which can be passed to be notified of when SwaggerUI has completed rendering successfully.
102103
onFailure | This is a callback function parameter which can be passed to be notified of when SwaggerUI encountered a failure was unable to render.
103104
highlightSizeThreshold | Any size response below this threshold will be highlighted syntactically, attempting to highlight large responses can lead to browser hangs, not including a threshold will default to highlight all returned responses.

dist/css/print.css

+7-7
Original file line numberDiff line numberDiff line change
@@ -1136,14 +1136,14 @@
11361136
font-size: 24px;
11371137
padding: 10px 0;
11381138
}
1139-
.swagger-section .api-popup-dialog p.error-msg {
1139+
.swagger-section .api-popup-dialog .error-msg {
11401140
padding-left: 5px;
11411141
padding-bottom: 5px;
11421142
}
1143-
.swagger-section .api-popup-dialog button.api-popup-authbtn {
1143+
.swagger-section .api-popup-dialog .api-popup-authbtn {
11441144
height: 30px;
11451145
}
1146-
.swagger-section .api-popup-dialog button.api-popup-cancel {
1146+
.swagger-section .api-popup-dialog .api-popup-cancel {
11471147
height: 30px;
11481148
}
11491149
.swagger-section .api-popup-scopes {
@@ -1153,14 +1153,14 @@
11531153
padding: 5px 0;
11541154
line-height: 20px;
11551155
}
1156-
.swagger-section .api-popup-scopes .api-scope-desc {
1157-
padding-left: 20px;
1158-
font-style: italic;
1159-
}
11601156
.swagger-section .api-popup-scopes li input {
11611157
position: relative;
11621158
top: 2px;
11631159
}
1160+
.swagger-section .api-popup-scopes .api-scope-desc {
1161+
padding-left: 20px;
1162+
font-style: italic;
1163+
}
11641164
.swagger-section .api-popup-actions {
11651165
padding-top: 10px;
11661166
}

dist/css/screen.css

+26-26
Original file line numberDiff line numberDiff line change
@@ -1136,14 +1136,14 @@
11361136
font-size: 24px;
11371137
padding: 10px 0;
11381138
}
1139-
.swagger-section .api-popup-dialog p.error-msg {
1139+
.swagger-section .api-popup-dialog .error-msg {
11401140
padding-left: 5px;
11411141
padding-bottom: 5px;
11421142
}
1143-
.swagger-section .api-popup-dialog button.api-popup-authbtn {
1143+
.swagger-section .api-popup-dialog .api-popup-authbtn {
11441144
height: 30px;
11451145
}
1146-
.swagger-section .api-popup-dialog button.api-popup-cancel {
1146+
.swagger-section .api-popup-dialog .api-popup-cancel {
11471147
height: 30px;
11481148
}
11491149
.swagger-section .api-popup-scopes {
@@ -1153,14 +1153,14 @@
11531153
padding: 5px 0;
11541154
line-height: 20px;
11551155
}
1156-
.swagger-section .api-popup-scopes .api-scope-desc {
1157-
padding-left: 20px;
1158-
font-style: italic;
1159-
}
11601156
.swagger-section .api-popup-scopes li input {
11611157
position: relative;
11621158
top: 2px;
11631159
}
1160+
.swagger-section .api-popup-scopes .api-scope-desc {
1161+
padding-left: 20px;
1162+
font-style: italic;
1163+
}
11641164
.swagger-section .api-popup-actions {
11651165
padding-top: 10px;
11661166
}
@@ -1234,32 +1234,29 @@
12341234
background-color: #89bf04;
12351235
padding: 14px;
12361236
}
1237-
.swagger-section #header a#logo {
1238-
font-size: 1.5em;
1239-
font-weight: bold;
1240-
text-decoration: none;
1241-
background: transparent url(../images/logo_small.png) no-repeat left center;
1242-
padding: 20px 0 20px 40px;
1243-
color: white;
1237+
.swagger-section #input_baseUrl {
1238+
width: 400px;
12441239
}
1245-
.swagger-section #header form#api_selector {
1240+
.swagger-section #api_selector {
12461241
display: block;
12471242
clear: none;
12481243
float: right;
12491244
}
1250-
.swagger-section #header form#api_selector .input {
1245+
.swagger-section #api_selector .input {
12511246
display: block;
12521247
clear: none;
12531248
float: left;
12541249
margin: 0 10px 0 0;
12551250
}
1256-
.swagger-section #header form#api_selector .input input#input_apiKey {
1257-
width: 200px;
1251+
.swagger-section #api_selector input {
1252+
font-size: 0.9em;
1253+
padding: 3px;
1254+
margin: 0;
12581255
}
1259-
.swagger-section #header form#api_selector .input input#input_baseUrl {
1260-
width: 400px;
1256+
.swagger-section #input_apiKey {
1257+
width: 200px;
12611258
}
1262-
.swagger-section #header form#api_selector .input a#explore {
1259+
.swagger-section #explore {
12631260
display: block;
12641261
text-decoration: none;
12651262
font-weight: bold;
@@ -1274,13 +1271,16 @@
12741271
-khtml-border-radius: 4px;
12751272
border-radius: 4px;
12761273
}
1277-
.swagger-section #header form#api_selector .input a#explore:hover {
1274+
.swagger-section #explore:hover {
12781275
background-color: #547f00;
12791276
}
1280-
.swagger-section #header form#api_selector .input input {
1281-
font-size: 0.9em;
1282-
padding: 3px;
1283-
margin: 0;
1277+
.swagger-section #header #logo {
1278+
font-size: 1.5em;
1279+
font-weight: bold;
1280+
text-decoration: none;
1281+
background: transparent url(../images/logo_small.png) no-repeat left center;
1282+
padding: 20px 0 20px 40px;
1283+
color: white;
12841284
}
12851285
.swagger-section #content_message {
12861286
margin: 10px 15px;

dist/index.html

+3-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,8 @@
5353
clientSecret: "your-client-secret-if-required",
5454
realm: "your-realms",
5555
appName: "your-app-name",
56-
scopeSeparator: ","
56+
scopeSeparator: ",",
57+
additionalQueryStringParams: {}
5758
});
5859
}
5960

@@ -73,6 +74,7 @@
7374
docExpansion: "none",
7475
jsonEditor:true,
7576
apisSorter: "alpha",
77+
defaultModelRendering: 'schema',
7678
showRequestHeaders: false
7779
});
7880

dist/lib/swagger-oauth.js

+5
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ var oauth2KeyName;
77
var redirect_uri;
88
var clientSecret;
99
var scopeSeparator;
10+
var additionalQueryStringParams;
1011

1112
function handleLogin() {
1213
var scopes = [];
@@ -156,6 +157,9 @@ function handleLogin() {
156157
url += '&client_id=' + encodeURIComponent(clientId);
157158
url += '&scope=' + encodeURIComponent(scopes.join(scopeSeparator));
158159
url += '&state=' + encodeURIComponent(state);
160+
for (var key in additionalQueryStringParams) {
161+
url += '&' + key + '=' + encodeURIComponent(additionalQueryStringParams[key]);
162+
}
159163

160164
window.open(url);
161165
});
@@ -190,6 +194,7 @@ function initOAuth(opts) {
190194
clientSecret = (o.clientSecret||null);
191195
realm = (o.realm||errors.push('missing realm'));
192196
scopeSeparator = (o.scopeSeparator||' ');
197+
additionalQueryStringParams = (o.additionalQueryStringParams||{});
193198

194199
if(errors.length > 0){
195200
log('auth unable initialize oauth: ' + errors);

0 commit comments

Comments
 (0)