Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
64dc3060b3 | ||
|
|
ae4961ded9 | ||
|
|
a7aea6784a | ||
|
|
6e7f2effec | ||
|
|
35d8dc101b | ||
|
|
8b877cafc9 | ||
|
|
d073c0a908 | ||
|
|
90021ad100 | ||
|
|
673613129f | ||
|
|
58460145f3 | ||
|
|
d9e81fdb4c | ||
|
|
10ad489439 | ||
|
|
4fe23ac2fe | ||
|
|
0f7aa4518c | ||
|
|
6763652f65 | ||
|
|
0d41d7d893 | ||
|
|
fdbdf177fe | ||
|
|
02da09efa2 | ||
|
|
5ca6c8972e | ||
|
|
921f76e7ee | ||
|
|
daf225ee0a | ||
|
|
cb5f9b643d | ||
|
|
b055fb176b | ||
|
|
68cd5d0d1b | ||
|
|
38750aec58 | ||
|
|
c0ab1dd4db | ||
|
|
ed6a330d5d | ||
|
|
e4c2236a68 | ||
|
|
6a753a4bc8 | ||
|
|
2905068997 | ||
|
|
f386054a53 | ||
|
|
1e19281a7b | ||
|
|
f8db172158 | ||
|
|
78b3678f74 | ||
|
|
fa5de88f5d | ||
|
|
6bfec976a0 | ||
|
|
353c8a39c5 | ||
|
|
4f467b4073 | ||
|
|
43760ec29f | ||
|
|
7ca8cdeffb | ||
|
|
fd3eb4f65a | ||
|
|
1142f01da1 | ||
|
|
d9e14e1e7d | ||
|
|
af068f787a | ||
|
|
8b01247192 | ||
|
|
8155330ae3 | ||
|
|
37d158bdc1 | ||
|
|
26d8aced96 | ||
|
|
878dad251d | ||
|
|
2ba1c100ae | ||
|
|
0b7c6f048c | ||
|
|
3787de8038 | ||
|
|
0f12d5d45c | ||
|
|
4e234cc3c7 | ||
|
|
7f0de6312e | ||
|
|
f8e5e57540 | ||
|
|
bfc6dbd50f | ||
|
|
842f477620 | ||
|
|
a0cce8e746 | ||
|
|
7e1a02be83 | ||
|
|
90f641059f | ||
|
|
5def48cf99 | ||
|
|
3494d44d3f | ||
|
|
f2a1caa379 | ||
|
|
7cdf83a932 | ||
|
|
1dc709446a | ||
|
|
60cf928e51 | ||
|
|
d2c9189a7c |
+14
@@ -1,5 +1,7 @@
|
||||
sudo: false
|
||||
language: node_js
|
||||
services:
|
||||
- docker
|
||||
node_js:
|
||||
- '4.2'
|
||||
install:
|
||||
@@ -7,3 +9,15 @@ install:
|
||||
- sh -e /etc/init.d/xvfb start
|
||||
- npm i -g jshint
|
||||
- npm install
|
||||
env:
|
||||
- DOCKER_IMAGE_NAME=swaggerapi/swagger-ui
|
||||
after_success:
|
||||
- if [ $DOCKER_HUB_USERNAME ]; then
|
||||
docker login --email=$DOCKER_HUB_EMAIL --username=$DOCKER_HUB_USERNAME --password=$DOCKER_HUB_PASSWORD;
|
||||
docker build -t $DOCKER_IMAGE_NAME .;
|
||||
if [ "$TRAVIS_TAG" != "master" && -z "$TRAVIS_TAG"]; then
|
||||
docker tag $DOCKER_IMAGE_NAME $DOCKER_IMAGE_NAME:$TRAVIS_TAG;
|
||||
fi;
|
||||
|
||||
docker push $DOCKER_IMAGE_NAME;
|
||||
fi;
|
||||
|
||||
+3
-2
@@ -1,12 +1,13 @@
|
||||
FROM alpine:3.3
|
||||
FROM alpine:3.4
|
||||
|
||||
MAINTAINER Roman Tarnavski
|
||||
|
||||
RUN apk add --update nginx
|
||||
RUN mkdir -p /run/nginx
|
||||
|
||||
COPY nginx.conf /etc/nginx/
|
||||
ADD ./dist/ /usr/share/nginx/html
|
||||
|
||||
EXPOSE 8080
|
||||
|
||||
CMD nginx -g 'daemon off;'
|
||||
CMD nginx -g 'daemon off;'
|
||||
|
||||
@@ -24,7 +24,7 @@ The OpenAPI Specification has undergone 4 revisions since initial creation in 20
|
||||
|
||||
Swagger UI Version | Release Date | OpenAPI Spec compatibility | Notes | Status
|
||||
------------------ | ------------ | -------------------------- | ----- | ------
|
||||
2.2.6 | 2016-10-14 | 1.1, 1.2, 2.0 | [tag v2.2.6](https://github.com/swagger-api/swagger-ui/tree/v2.2.6) |
|
||||
2.2.10 | 2017-01-04 | 1.1, 1.2, 2.0 | [tag v2.2.10](https://github.com/swagger-api/swagger-ui/tree/v2.2.6) |
|
||||
2.1.5 | 2016-07-20 | 1.1, 1.2, 2.0 | [tag v2.1.5](https://github.com/swagger-api/swagger-ui/tree/v2.1.5) |
|
||||
2.0.24 | 2014-09-12 | 1.1, 1.2 | [tag v2.0.24](https://github.com/swagger-api/swagger-ui/tree/v2.0.24) |
|
||||
1.0.13 | 2013-03-08 | 1.1, 1.2 | [tag v1.0.13](https://github.com/swagger-api/swagger-ui/tree/v1.0.13) |
|
||||
@@ -50,6 +50,13 @@ You can rebuild swagger-ui on your own to tweak it or just so you can say you di
|
||||
### Development
|
||||
Use `npm run serve` to make a new build, watch for changes, and serve the result at http://localhost:8080/.
|
||||
|
||||
### Running with Docker
|
||||
|
||||
```
|
||||
docker pull swaggerapi/swagger-ui
|
||||
docker run -p 80:8080 swaggerapi/swagger-ui
|
||||
```
|
||||
|
||||
### Build using Docker
|
||||
|
||||
To build swagger-ui using a docker container:
|
||||
|
||||
+23
-23
@@ -1,24 +1,24 @@
|
||||
{
|
||||
"name": "swagger-api/swagger-ui",
|
||||
"description": "Swagger UI is a dependency-free collection of HTML, JavaScript, and CSS assets that dynamically generate beautiful documentation from a Swagger-compliant API",
|
||||
"keywords": [
|
||||
"Swagger",
|
||||
"OpenAPI",
|
||||
"specification",
|
||||
"documentation",
|
||||
"API",
|
||||
"UI"
|
||||
],
|
||||
"homepage": "http://swagger.io",
|
||||
"license": "Apache-2.0",
|
||||
"authors": [
|
||||
{
|
||||
"name": "Tony Tam",
|
||||
"email": "fehguy@gmail.com"
|
||||
},
|
||||
{
|
||||
"name": "Mohsen Azimi",
|
||||
"email": "me@azimi.me"
|
||||
}
|
||||
]
|
||||
}
|
||||
"name": "swagger-api/swagger-ui",
|
||||
"description": "Swagger UI is a dependency-free collection of HTML, JavaScript, and CSS assets that dynamically generate beautiful documentation from a Swagger-compliant API",
|
||||
"keywords": [
|
||||
"Swagger",
|
||||
"OpenAPI",
|
||||
"specification",
|
||||
"documentation",
|
||||
"API",
|
||||
"UI"
|
||||
],
|
||||
"homepage": "http://swagger.io",
|
||||
"license": "Apache-2.0",
|
||||
"authors": [
|
||||
{
|
||||
"name": "Tony Tam",
|
||||
"email": "fehguy@gmail.com"
|
||||
},
|
||||
{
|
||||
"name": "Mohsen Azimi",
|
||||
"email": "me@azimi.me"
|
||||
}
|
||||
]
|
||||
}
|
||||
Vendored
+1
-1
File diff suppressed because one or more lines are too long
Vendored
+1
-1
File diff suppressed because one or more lines are too long
Vendored
+1
-1
@@ -1 +1 @@
|
||||
.swagger-section #header a#logo{font-size:1.5em;font-weight:700;text-decoration:none;background:transparent url(../images/logo.png) no-repeat 0;padding:20px 0 20px 40px}#text-head{font-size:80px;font-family:Roboto,sans-serif;color:#fff;float:right;margin-right:20%}.navbar-fixed-top .navbar-brand,.navbar-fixed-top .navbar-nav,.navbar-header{height:auto}.navbar-inverse{background-color:#000;border-color:#000}#navbar-brand{margin-left:20%}.navtext{font-size:10px}.h1,h1{font-size:60px}.navbar-default .navbar-header .navbar-brand{color:#a2dfee}.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading h2 a{color:#393939;font-family:Arvo,serif;font-size:1.5em}.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading h2 a:hover{color:#000}.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading h2{color:#525252;padding-left:0;display:block;clear:none;float:left;font-family:Arvo,serif;font-weight:700}.navbar-default .navbar-collapse,.navbar-default .navbar-form{border-color:#0a0a0a}.container1{width:1500px;margin:auto;margin-top:0;background-image:url(../images/shield.png);background-repeat:no-repeat;background-position:-40px -20px;margin-bottom:210px}.container-inner{width:1200px;margin:auto;background-color:hsla(192,8%,88%,.75);padding-bottom:40px;padding-top:40px;border-radius:15px}.header-content{padding:0;width:1000px}.title1{font-size:80px;font-family:Vollkorn,serif;color:#404040;text-align:center;padding-top:40px;padding-bottom:100px}#icon{margin-top:-18px}.subtext{font-size:25px;font-style:italic;color:#08b;text-align:right;padding-right:250px}.bg-primary{background-color:#00468b}.navbar-default .nav>li>a,.navbar-default .nav>li>a:focus,.navbar-default .nav>li>a:focus:hover,.navbar-default .nav>li>a:hover{color:#08b}.text-faded{font-size:25px;font-family:Vollkorn,serif}.section-heading{font-family:Vollkorn,serif;font-size:45px;padding-bottom:10px}hr{border-color:#00468b;padding-bottom:10px}.description{margin-top:20px;padding-bottom:200px}.description li{font-family:Vollkorn,serif;font-size:25px;color:#525252;margin-left:28%;padding-top:5px}.gap{margin-top:200px}.troubleshootingtext{color:hsla(0,0%,100%,.7);padding-left:30%}.troubleshootingtext li{list-style-type:circle;font-size:25px;padding-bottom:5px}.overlay{position:absolute;top:0;left:0;width:100%;height:100%;z-index:1}.block.response_body.json:hover{cursor:pointer}.backdrop{color:blue}#myModal{height:100%}.modal-backdrop{bottom:0;position:fixed}.curl{padding:10px;font-family:Anonymous Pro,Menlo,Consolas,Bitstream Vera Sans Mono,Courier New,monospace;font-size:.9em;max-height:400px;margin-top:5px;overflow-y:auto;background-color:#fcf6db;border:1px solid #e5e0c6;border-radius:4px}.curl_title{font-size:1.1em;margin:0;padding:15px 0 5px;font-family:Open Sans,Helvetica Neue,Arial,sans-serif;font-weight:500;line-height:1.1}.footer{display:none}.swagger-section .swagger-ui-wrap h2{padding:0}h2{margin:0;margin-bottom:5px}.markdown p,.swagger-section .swagger-ui-wrap .code{font-size:15px;font-family:Arvo,serif}.swagger-section .swagger-ui-wrap b{font-family:Arvo,serif}#signin:hover{cursor:pointer}.dropdown-menu{padding:15px}.navbar-right .dropdown-menu{left:0;right:auto}#signinbutton{width:100%;height:32px;font-size:13px;font-weight:700;color:#08b}.navbar-default .nav>li .details{color:#000;text-transform:none;font-size:15px;font-weight:400;font-family:Open Sans,sans-serif;font-style:italic;line-height:20px;top:-2px}.navbar-default .nav>li .details:hover{color:#000}#signout{width:100%;height:32px;font-size:13px;font-weight:700;color:#08b}
|
||||
.swagger-section #header a#logo{font-size:1.5em;font-weight:700;text-decoration:none;padding:20px 0 20px 40px}#text-head{font-size:80px;font-family:Roboto,sans-serif;color:#fff;float:right;margin-right:20%}.navbar-fixed-top .navbar-brand,.navbar-fixed-top .navbar-nav,.navbar-header{height:auto}.navbar-inverse{background-color:#000;border-color:#000}#navbar-brand{margin-left:20%}.navtext{font-size:10px}.h1,h1{font-size:60px}.navbar-default .navbar-header .navbar-brand{color:#a2dfee}.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading h2 a{color:#393939;font-family:Arvo,serif;font-size:1.5em}.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading h2 a:hover{color:#000}.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading h2{color:#525252;padding-left:0;display:block;clear:none;float:left;font-family:Arvo,serif;font-weight:700}.navbar-default .navbar-collapse,.navbar-default .navbar-form{border-color:#0a0a0a}.container1{width:1500px;margin:auto;margin-top:0;background-repeat:no-repeat;background-position:-40px -20px;margin-bottom:210px}.container-inner{width:1200px;margin:auto;background-color:hsla(192,8%,88%,.75);padding-bottom:40px;padding-top:40px;border-radius:15px}.header-content{padding:0;width:1000px}.title1{font-size:80px;font-family:Vollkorn,serif;color:#404040;text-align:center;padding-top:40px;padding-bottom:100px}#icon{margin-top:-18px}.subtext{font-size:25px;font-style:italic;color:#08b;text-align:right;padding-right:250px}.bg-primary{background-color:#00468b}.navbar-default .nav>li>a,.navbar-default .nav>li>a:focus,.navbar-default .nav>li>a:focus:hover,.navbar-default .nav>li>a:hover{color:#08b}.text-faded{font-size:25px;font-family:Vollkorn,serif}.section-heading{font-family:Vollkorn,serif;font-size:45px;padding-bottom:10px}hr{border-color:#00468b;padding-bottom:10px}.description{margin-top:20px;padding-bottom:200px}.description li{font-family:Vollkorn,serif;font-size:25px;color:#525252;margin-left:28%;padding-top:5px}.gap{margin-top:200px}.troubleshootingtext{color:hsla(0,0%,100%,.7);padding-left:30%}.troubleshootingtext li{list-style-type:circle;font-size:25px;padding-bottom:5px}.overlay{position:absolute;top:0;left:0;width:100%;height:100%;z-index:1}.block.response_body.json:hover{cursor:pointer}.backdrop{color:blue}#myModal{height:100%}.modal-backdrop{bottom:0;position:fixed}.curl{padding:10px;font-family:Anonymous Pro,Menlo,Consolas,Bitstream Vera Sans Mono,Courier New,monospace;font-size:.9em;max-height:400px;margin-top:5px;overflow-y:auto;background-color:#fcf6db;border:1px solid #e5e0c6;border-radius:4px}.curl_title{font-size:1.1em;margin:0;padding:15px 0 5px;font-family:Open Sans,Helvetica Neue,Arial,sans-serif;font-weight:500;line-height:1.1}.footer{display:none}.swagger-section .swagger-ui-wrap h2{padding:0}h2{margin:0;margin-bottom:5px}.markdown p,.swagger-section .swagger-ui-wrap .code{font-size:15px;font-family:Arvo,serif}.swagger-section .swagger-ui-wrap b{font-family:Arvo,serif}#signin:hover{cursor:pointer}.dropdown-menu{padding:15px}.navbar-right .dropdown-menu{left:0;right:auto}#signinbutton{width:100%;height:32px;font-size:13px;font-weight:700;color:#08b}.navbar-default .nav>li .details{color:#000;text-transform:none;font-size:15px;font-weight:400;font-family:Open Sans,sans-serif;font-style:italic;line-height:20px;top:-2px}.navbar-default .nav>li .details:hover{color:#000}#signout{width:100%;height:32px;font-size:13px;font-weight:700;color:#08b}
|
||||
Vendored
+3
-1
@@ -2,6 +2,7 @@
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="x-ua-compatible" content="IE=edge">
|
||||
<title>Swagger UI</title>
|
||||
<link rel="icon" type="image/png" href="images/favicon-32x32.png" sizes="32x32" />
|
||||
<link rel="icon" type="image/png" href="images/favicon-16x16.png" sizes="16x16" />
|
||||
@@ -74,7 +75,8 @@
|
||||
docExpansion: "none",
|
||||
jsonEditor: false,
|
||||
defaultModelRendering: 'schema',
|
||||
showRequestHeaders: false
|
||||
showRequestHeaders: false,
|
||||
showOperationIds: false
|
||||
});
|
||||
|
||||
window.swaggerUi.load();
|
||||
|
||||
Vendored
+1
-1
File diff suppressed because one or more lines are too long
Vendored
+1
-1
@@ -1,6 +1,6 @@
|
||||
<script>
|
||||
var qp = null;
|
||||
if(window.location.hash && window.location.hash !== "#_=_") {
|
||||
if(/code|token|error/.test(window.location.hash)) {
|
||||
qp = location.hash.substring(1);
|
||||
}
|
||||
else {
|
||||
|
||||
Vendored
+297
-79
File diff suppressed because one or more lines are too long
Vendored
+15
-14
File diff suppressed because one or more lines are too long
+16
-5
@@ -121,7 +121,18 @@ function handleLogin() {
|
||||
//TODO: merge not replace if scheme is different from any existing
|
||||
//(needs to be aware of schemes to do so correctly)
|
||||
window.enabledScopes=scopes;
|
||||
|
||||
|
||||
/**
|
||||
* Returns the name of the access token parameter returned by the server.
|
||||
*
|
||||
* @param dets
|
||||
* The authorisation scheme configuration.
|
||||
* @return the name of the access token parameter
|
||||
*/
|
||||
function getTokenName(dets) {
|
||||
return dets.vendorExtensions['x-tokenName'] || dets.tokenName;
|
||||
}
|
||||
|
||||
for (var key in authSchemes) {
|
||||
if (authSchemes.hasOwnProperty(key) && OAuthSchemeKeys.indexOf(key) != -1) { //only look at keys that match this scope.
|
||||
var flow = authSchemes[key].flow;
|
||||
@@ -129,13 +140,13 @@ function handleLogin() {
|
||||
if(authSchemes[key].type === 'oauth2' && flow && (flow === 'implicit' || flow === 'accessCode')) {
|
||||
var dets = authSchemes[key];
|
||||
url = dets.authorizationUrl + '?response_type=' + (flow === 'implicit' ? 'token' : 'code');
|
||||
window.swaggerUi.tokenName = dets.tokenName || 'access_token';
|
||||
window.swaggerUi.tokenName = getTokenName(dets) || 'access_token';
|
||||
window.swaggerUi.tokenUrl = (flow === 'accessCode' ? dets.tokenUrl : null);
|
||||
state = key;
|
||||
}
|
||||
else if(authSchemes[key].type === 'oauth2' && flow && (flow === 'application')) {
|
||||
var dets = authSchemes[key];
|
||||
window.swaggerUi.tokenName = dets.tokenName || 'access_token';
|
||||
window.swaggerUi.tokenName = getTokenName(dets) || 'access_token';
|
||||
clientCredentialsFlow(scopes, dets.tokenUrl, key);
|
||||
return;
|
||||
}
|
||||
@@ -147,13 +158,13 @@ function handleLogin() {
|
||||
var dets = o[t];
|
||||
var ep = dets.loginEndpoint.url;
|
||||
url = dets.loginEndpoint.url + '?response_type=token';
|
||||
window.swaggerUi.tokenName = dets.tokenName;
|
||||
window.swaggerUi.tokenName = getTokenName(dets);
|
||||
}
|
||||
else if (o.hasOwnProperty(t) && t === 'accessCode') {
|
||||
var dets = o[t];
|
||||
var ep = dets.tokenRequestEndpoint.url;
|
||||
url = dets.tokenRequestEndpoint.url + '?response_type=code';
|
||||
window.swaggerUi.tokenName = dets.tokenName;
|
||||
window.swaggerUi.tokenName = getTokenName(dets);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+27
-2
@@ -17,8 +17,33 @@ http {
|
||||
server_name localhost;
|
||||
|
||||
location / {
|
||||
root html;
|
||||
root /usr/share/nginx/html;
|
||||
index index.html index.htm;
|
||||
if ($request_method = 'OPTIONS') {
|
||||
add_header 'Access-Control-Allow-Origin' '*';
|
||||
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
|
||||
#
|
||||
# Custom headers and headers various browsers *should* be OK with but aren't
|
||||
#
|
||||
add_header 'Access-Control-Allow-Headers' 'DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type';
|
||||
#
|
||||
# Tell client that this pre-flight info is valid for 20 days
|
||||
#
|
||||
add_header 'Access-Control-Max-Age' 1728000;
|
||||
add_header 'Content-Type' 'text/plain charset=UTF-8';
|
||||
add_header 'Content-Length' 0;
|
||||
return 204;
|
||||
}
|
||||
if ($request_method = 'POST') {
|
||||
add_header 'Access-Control-Allow-Origin' '*';
|
||||
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
|
||||
add_header 'Access-Control-Allow-Headers' 'DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type';
|
||||
}
|
||||
if ($request_method = 'GET') {
|
||||
add_header 'Access-Control-Allow-Origin' '*';
|
||||
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
|
||||
add_header 'Access-Control-Allow-Headers' 'DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type';
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -8,7 +8,7 @@
|
||||
}
|
||||
],
|
||||
"description": "Swagger UI is a dependency-free collection of HTML, JavaScript, and CSS assets that dynamically generate beautiful documentation from a Swagger-compliant API",
|
||||
"version": "2.2.8",
|
||||
"version": "2.2.10",
|
||||
"homepage": "http://swagger.io",
|
||||
"license": "Apache-2.0",
|
||||
"main": "dist/swagger-ui.js",
|
||||
@@ -63,6 +63,6 @@
|
||||
"run-sequence": "^1.2.2",
|
||||
"selenium-webdriver": "^2.45.0",
|
||||
"sinon-chai": "2.8.0",
|
||||
"swagger-client": "2.1.25"
|
||||
"swagger-client": "2.1.29"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -422,7 +422,8 @@
|
||||
font-size: .85em;
|
||||
line-height: 1.2em;
|
||||
overflow: auto;
|
||||
max-height: 200px;
|
||||
height: 200px;
|
||||
resize: vertical;
|
||||
cursor: pointer;
|
||||
}
|
||||
.swagger-section .swagger-ui-wrap .model-signature ul.signature-nav {
|
||||
@@ -837,6 +838,11 @@
|
||||
padding: 0;
|
||||
line-height: inherit;
|
||||
}
|
||||
.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading ul.options li a .nickname {
|
||||
color: #aaaaaa;
|
||||
padding: 0;
|
||||
line-height: inherit;
|
||||
}
|
||||
.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading ul.options li.access {
|
||||
color: black;
|
||||
}
|
||||
@@ -1344,6 +1350,10 @@
|
||||
.swagger-section .api-popup-actions {
|
||||
padding-top: 10px;
|
||||
}
|
||||
.swagger-section fieldset {
|
||||
padding-bottom: 10px;
|
||||
padding-left: 20px;
|
||||
}
|
||||
#header {
|
||||
display: none;
|
||||
}
|
||||
|
||||
@@ -422,7 +422,8 @@
|
||||
font-size: .85em;
|
||||
line-height: 1.2em;
|
||||
overflow: auto;
|
||||
max-height: 200px;
|
||||
height: 200px;
|
||||
resize: vertical;
|
||||
cursor: pointer;
|
||||
}
|
||||
.swagger-section .swagger-ui-wrap .model-signature ul.signature-nav {
|
||||
@@ -837,6 +838,11 @@
|
||||
padding: 0;
|
||||
line-height: inherit;
|
||||
}
|
||||
.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading ul.options li a .nickname {
|
||||
color: #aaaaaa;
|
||||
padding: 0;
|
||||
line-height: inherit;
|
||||
}
|
||||
.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading ul.options li.access {
|
||||
color: black;
|
||||
}
|
||||
@@ -1344,6 +1350,10 @@
|
||||
.swagger-section .api-popup-actions {
|
||||
padding-top: 10px;
|
||||
}
|
||||
.swagger-section fieldset {
|
||||
padding-bottom: 10px;
|
||||
padding-left: 20px;
|
||||
}
|
||||
.swagger-section .access {
|
||||
float: right;
|
||||
}
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
font-size: 1.5em;
|
||||
font-weight: bold;
|
||||
text-decoration: none;
|
||||
background: transparent url(../images/logo.png) no-repeat left center;
|
||||
padding: 20px 0 20px 40px;
|
||||
}
|
||||
#text-head {
|
||||
@@ -64,7 +63,6 @@ h1 {
|
||||
width: 1500px;
|
||||
margin: auto;
|
||||
margin-top: 0;
|
||||
background-image: url('../images/shield.png');
|
||||
background-repeat: no-repeat;
|
||||
background-position: -40px -20px;
|
||||
margin-bottom: 210px;
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="x-ua-compatible" content="IE=edge">
|
||||
<title>Swagger UI</title>
|
||||
<link rel="icon" type="image/png" href="images/favicon-32x32.png" sizes="32x32" />
|
||||
<link rel="icon" type="image/png" href="images/favicon-16x16.png" sizes="16x16" />
|
||||
@@ -74,7 +75,8 @@
|
||||
docExpansion: "none",
|
||||
jsonEditor: false,
|
||||
defaultModelRendering: 'schema',
|
||||
showRequestHeaders: false
|
||||
showRequestHeaders: false,
|
||||
showOperationIds: false
|
||||
});
|
||||
|
||||
window.swaggerUi.load();
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<script>
|
||||
var qp = null;
|
||||
if(window.location.hash && window.location.hash !== "#_=_") {
|
||||
if(/code|token|error/.test(window.location.hash)) {
|
||||
qp = location.hash.substring(1);
|
||||
}
|
||||
else {
|
||||
|
||||
@@ -109,17 +109,34 @@ SwaggerUi.Views.AuthView = Backbone.View.extend({
|
||||
window.enabledScopes = scopes;
|
||||
var flow = auth.get('flow');
|
||||
|
||||
/**
|
||||
* Returns the name of the access token parameter returned by the server.
|
||||
*
|
||||
* @param dets
|
||||
* The authorisation scheme configuration.
|
||||
* @return the name of the access token parameter
|
||||
*/
|
||||
function getTokenName(dets) {
|
||||
return dets.vendorExtensions['x-tokenName'] || dets.tokenName;
|
||||
}
|
||||
|
||||
if(auth.get('type') === 'oauth2' && flow && (flow === 'implicit' || flow === 'accessCode')) {
|
||||
dets = auth.attributes;
|
||||
url = dets.authorizationUrl + '?response_type=' + (flow === 'implicit' ? 'token' : 'code');
|
||||
container.tokenName = dets.tokenName || 'access_token';
|
||||
container.tokenName = getTokenName(dets) || 'access_token';
|
||||
container.tokenUrl = (flow === 'accessCode' ? dets.tokenUrl : null);
|
||||
state = container.OAuthSchemeKey;
|
||||
}
|
||||
else if(auth.get('type') === 'oauth2' && flow && (flow === 'application')) {
|
||||
dets = auth.attributes;
|
||||
container.tokenName = dets.tokenName || 'access_token';
|
||||
this.clientCredentialsFlow(scopes, dets.tokenUrl, container.OAuthSchemeKey);
|
||||
container.tokenName = getTokenName(dets) || 'access_token';
|
||||
this.clientCredentialsFlow(scopes, dets, container.OAuthSchemeKey);
|
||||
return;
|
||||
}
|
||||
else if(auth.get('type') === 'oauth2' && flow && (flow === 'password')) {
|
||||
dets = auth.attributes;
|
||||
container.tokenName = getTokenName(dets) || 'access_token';
|
||||
this.passwordFlow(scopes, dets, container.OAuthSchemeKey);
|
||||
return;
|
||||
}
|
||||
else if(auth.get('grantTypes')) {
|
||||
@@ -130,13 +147,13 @@ SwaggerUi.Views.AuthView = Backbone.View.extend({
|
||||
dets = o[t];
|
||||
ep = dets.loginEndpoint.url;
|
||||
url = dets.loginEndpoint.url + '?response_type=token';
|
||||
container.tokenName = dets.tokenName;
|
||||
container.tokenName = getTokenName(dets);
|
||||
}
|
||||
else if (o.hasOwnProperty(t) && t === 'accessCode') {
|
||||
dets = o[t];
|
||||
ep = dets.tokenRequestEndpoint.url;
|
||||
url = dets.tokenRequestEndpoint.url + '?response_type=code';
|
||||
container.tokenName = dets.tokenName;
|
||||
container.tokenName = getTokenName(dets);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -156,17 +173,40 @@ SwaggerUi.Views.AuthView = Backbone.View.extend({
|
||||
},
|
||||
|
||||
// taken from lib/swagger-oauth.js
|
||||
clientCredentialsFlow: function (scopes, tokenUrl, OAuthSchemeKey) {
|
||||
var params = {
|
||||
'client_id': clientId,
|
||||
'client_secret': clientSecret,
|
||||
clientCredentialsFlow: function (scopes, oauth, OAuthSchemeKey) {
|
||||
this.accessTokenRequest(scopes, oauth, OAuthSchemeKey, 'client_credentials');
|
||||
},
|
||||
|
||||
passwordFlow: function (scopes, oauth, OAuthSchemeKey) {
|
||||
this.accessTokenRequest(scopes, oauth, OAuthSchemeKey, 'password', {
|
||||
'username': oauth.username,
|
||||
'password': oauth.password
|
||||
});
|
||||
},
|
||||
|
||||
accessTokenRequest: function (scopes, oauth, OAuthSchemeKey, grantType, params) {
|
||||
params = $.extend({}, {
|
||||
'scope': scopes.join(' '),
|
||||
'grant_type': 'client_credentials'
|
||||
};
|
||||
'grant_type': grantType
|
||||
}, params);
|
||||
|
||||
var headers= {};
|
||||
|
||||
switch (oauth.clientAuthenticationType) {
|
||||
case 'basic':
|
||||
headers.Authorization = 'Basic ' + btoa(oauth.clientId + ':' + oauth.clientSecret);
|
||||
break;
|
||||
case 'request-body':
|
||||
params.client_id = oauth.clientId;
|
||||
params.client_secret = oauth.clientSecret;
|
||||
break;
|
||||
}
|
||||
|
||||
$.ajax({
|
||||
url : tokenUrl,
|
||||
url : oauth.tokenUrl,
|
||||
type: 'POST',
|
||||
data: params,
|
||||
headers: headers,
|
||||
success: function (data)
|
||||
{
|
||||
onOAuthComplete(data, OAuthSchemeKey);
|
||||
@@ -177,5 +217,4 @@ SwaggerUi.Views.AuthView = Backbone.View.extend({
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
@@ -111,7 +111,7 @@ SwaggerUi.Views.MainView = Backbone.View.extend({
|
||||
|
||||
addResource: function(resource, auths){
|
||||
// Render a resource and add it to resources li
|
||||
resource.id = resource.id.replace(/\s/g, '_');
|
||||
resource.id = resource.id.replace(/[^a-zA-Z\d]/g, function(str) { return str.charCodeAt(0); });
|
||||
|
||||
// Make all definitions available at the root of the resource so that they can
|
||||
// be loaded by the JSonEditor
|
||||
|
||||
@@ -2,7 +2,9 @@
|
||||
|
||||
SwaggerUi.Models.Oauth2Model = Backbone.Model.extend({
|
||||
defaults: {
|
||||
scopes: {}
|
||||
scopes: {},
|
||||
isPasswordFlow: false,
|
||||
clientAuthenticationType: 'none'
|
||||
},
|
||||
|
||||
initialize: function () {
|
||||
@@ -19,6 +21,13 @@ SwaggerUi.Models.Oauth2Model = Backbone.Model.extend({
|
||||
attributes.scopes = scopes;
|
||||
this.attributes = attributes;
|
||||
}
|
||||
|
||||
if (this.attributes && this.attributes.flow) {
|
||||
var flow = this.attributes.flow;
|
||||
this.set('isPasswordFlow', flow === 'password');
|
||||
this.set('requireClientAuthentication', flow === 'application');
|
||||
this.set('clientAuthentication', flow === 'password' || flow === 'application');
|
||||
}
|
||||
this.on('change', this.validate);
|
||||
},
|
||||
|
||||
@@ -35,6 +44,16 @@ SwaggerUi.Models.Oauth2Model = Backbone.Model.extend({
|
||||
|
||||
validate: function () {
|
||||
var valid = false;
|
||||
if (this.get('isPasswordFlow') &&
|
||||
(!this.get('username'))) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (this.get('clientAuthenticationType') in ['basic', 'request-body'] &&
|
||||
(!this.get('clientId'))) {
|
||||
return false;
|
||||
}
|
||||
|
||||
var scp = this.get('scopes');
|
||||
var idx = _.findIndex(scp, function (o) {
|
||||
return o.checked === true;
|
||||
|
||||
@@ -2,11 +2,20 @@
|
||||
|
||||
SwaggerUi.Views.Oauth2View = Backbone.View.extend({
|
||||
events: {
|
||||
'change .oauth-scope': 'scopeChange'
|
||||
'change .oauth-scope': 'scopeChange',
|
||||
'change .oauth-username': 'setUsername',
|
||||
'change .oauth-password': 'setPassword',
|
||||
'change .oauth-client-authentication-type': 'setClientAuthenticationType',
|
||||
'change .oauth-client-id': 'setClientId',
|
||||
'change .oauth-client-secret': 'setClientSecret'
|
||||
},
|
||||
|
||||
template: Handlebars.templates.oauth2,
|
||||
|
||||
cls: {
|
||||
error: 'error'
|
||||
},
|
||||
|
||||
render: function () {
|
||||
this.$el.html(this.template(this.model.toJSON()));
|
||||
|
||||
@@ -18,5 +27,57 @@ SwaggerUi.Views.Oauth2View = Backbone.View.extend({
|
||||
var scope = $(e.target).data('scope');
|
||||
|
||||
this.model.setScopes(scope, val);
|
||||
},
|
||||
|
||||
setUsername: function (e) {
|
||||
var val= $(e.target).val();
|
||||
this.model.set('username', val);
|
||||
if (val) {
|
||||
$(e.target).removeClass(this.cls.error);
|
||||
}
|
||||
},
|
||||
|
||||
setPassword: function (e) {
|
||||
this.model.set('password', $(e.target).val());
|
||||
},
|
||||
|
||||
setClientAuthenticationType: function (e) {
|
||||
var type = $(e.target).val();
|
||||
var $el = this.$el;
|
||||
this.model.set('clientAuthenticationType', type);
|
||||
|
||||
switch(type) {
|
||||
case 'none':
|
||||
$el.find('.oauth-client-authentication').hide();
|
||||
break;
|
||||
case 'basic':
|
||||
case 'request-body':
|
||||
$el.find('.oauth-client-id').removeClass(this.cls.error);
|
||||
$el.find('.oauth-client-authentication').show();
|
||||
break;
|
||||
}
|
||||
},
|
||||
|
||||
setClientId: function (e) {
|
||||
var val = $(e.target).val();
|
||||
this.model.set('clientId', val);
|
||||
if (val) {
|
||||
$(e.target).removeClass(this.cls.error);
|
||||
}
|
||||
},
|
||||
|
||||
setClientSecret: function (e) {
|
||||
this.model.set('clientSecret', $(e.target).val());
|
||||
$(e.target).removeClass('error');
|
||||
},
|
||||
|
||||
highlightInvalid: function () {
|
||||
if (!this.model.get('username')) {
|
||||
this.$el.find('.oauth-username').addClass(this.cls.error);
|
||||
}
|
||||
|
||||
if (!this.model.get('clientId')) {
|
||||
this.$el.find('.oauth-client-id').addClass(this.cls.error);
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -27,6 +27,10 @@ SwaggerUi.Views.OperationView = Backbone.View.extend({
|
||||
if (opts.swaggerOptions.showRequestHeaders) {
|
||||
this.model.showRequestHeaders = true;
|
||||
}
|
||||
|
||||
if (opts.swaggerOptions.showOperationIds) {
|
||||
this.model.showOperationIds = true;
|
||||
}
|
||||
}
|
||||
return this;
|
||||
},
|
||||
@@ -683,6 +687,7 @@ SwaggerUi.Views.OperationView = Backbone.View.extend({
|
||||
|
||||
var pre;
|
||||
var code;
|
||||
var skipHighlight = false;
|
||||
if (!content) {
|
||||
code = $('<code />').text('no content');
|
||||
pre = $('<pre class="json" />').append(code);
|
||||
@@ -717,6 +722,7 @@ SwaggerUi.Views.OperationView = Backbone.View.extend({
|
||||
var responseFilename = /filename=([^;]*);?/.exec(disposition);
|
||||
if(responseFilename !== null && responseFilename.length > 1) {
|
||||
download = responseFilename[1];
|
||||
fileName = download;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -725,6 +731,7 @@ SwaggerUi.Views.OperationView = Backbone.View.extend({
|
||||
a.innerText = 'Download ' + fileName;
|
||||
|
||||
pre = $('<div/>').append(a);
|
||||
skipHighlight = true;
|
||||
} else {
|
||||
pre = $('<pre class="json" />').append('Download headers detected but your browser does not support downloading binary via XHR (Blob).');
|
||||
}
|
||||
@@ -798,9 +805,14 @@ SwaggerUi.Views.OperationView = Backbone.View.extend({
|
||||
$('.request_headers', $(this.el)).html('<pre>' + _.escape(JSON.stringify(requestHeaders, null, ' ')).replace(/\n/g, '<br>') + '</pre>');
|
||||
}
|
||||
|
||||
// Call user-defined hook
|
||||
if (opts.responseHooks && opts.responseHooks[this.nickname]) {
|
||||
opts.responseHooks[this.nickname](response, this);
|
||||
}
|
||||
|
||||
var response_body_el = $('.response_body', $(this.el))[0];
|
||||
// only highlight the response if response is less than threshold, default state is highlight response
|
||||
if (opts.highlightSizeThreshold && typeof response.data !== 'undefined' && response.data.length > opts.highlightSizeThreshold) {
|
||||
if (opts.highlightSizeThreshold && typeof response.data !== 'undefined' && response.data.length > opts.highlightSizeThreshold || skipHighlight) {
|
||||
return response_body_el;
|
||||
} else {
|
||||
return hljs.highlightBlock(response_body_el);
|
||||
|
||||
@@ -689,7 +689,8 @@ SwaggerUi.partials.signature = (function () {
|
||||
return str.join('');
|
||||
};
|
||||
|
||||
var getName = function (name, xml) {
|
||||
// Commenting this funtion as the names are now determined beforehand and the prefix part is exposed as a separate function | https://github.com/swagger-api/swagger-ui/issues/2577
|
||||
/** var getName = function (name, xml) {
|
||||
var result = name || '';
|
||||
|
||||
xml = xml || {};
|
||||
@@ -704,6 +705,19 @@ SwaggerUi.partials.signature = (function () {
|
||||
|
||||
return result;
|
||||
};
|
||||
*/
|
||||
|
||||
var getPrefix = function (name, xml) {
|
||||
var result = name || '';
|
||||
|
||||
xml = xml || {};
|
||||
|
||||
if (xml.prefix) {
|
||||
result = xml.prefix + ':' + result;
|
||||
}
|
||||
|
||||
return result;
|
||||
};
|
||||
|
||||
var getNamespace = function (xml) {
|
||||
var namespace = '';
|
||||
@@ -739,9 +753,12 @@ SwaggerUi.partials.signature = (function () {
|
||||
var attributes = [];
|
||||
|
||||
if (!items) { return getErrorMessage(); }
|
||||
|
||||
value = createSchemaXML(name, items, models, config);
|
||||
|
||||
var key = name;
|
||||
// If there is a name specified for the array elements, use that for the array elements name | https://github.com/swagger-api/swagger-ui/issues/2577
|
||||
if(items.xml && items.xml.name) {
|
||||
key = items.xml.name;
|
||||
}
|
||||
value = createSchemaXML(key, items, models, config);
|
||||
if (namespace) {
|
||||
attributes.push(namespace);
|
||||
}
|
||||
@@ -827,7 +844,7 @@ SwaggerUi.partials.signature = (function () {
|
||||
|
||||
if (namespace) {
|
||||
attrs.push(namespace);
|
||||
}
|
||||
}
|
||||
|
||||
if (!properties && !additionalProperties) { return getErrorMessage(); }
|
||||
|
||||
@@ -872,9 +889,10 @@ SwaggerUi.partials.signature = (function () {
|
||||
var output, index;
|
||||
config = config || {};
|
||||
config.modelsToIgnore = config.modelsToIgnore || [];
|
||||
|
||||
var descriptor = _.isString($ref) ? getDescriptorByRef($ref, name, models, config)
|
||||
: getDescriptor(name, definition, models, config);
|
||||
|
||||
|
||||
if (!descriptor) {
|
||||
return getErrorMessage();
|
||||
}
|
||||
@@ -904,10 +922,10 @@ SwaggerUi.partials.signature = (function () {
|
||||
if (arguments.length < 4) {
|
||||
throw new Error();
|
||||
}
|
||||
|
||||
this.config = config || {};
|
||||
this.config.modelsToIgnore = this.config.modelsToIgnore || [];
|
||||
this.name = getName(name, definition.xml);
|
||||
// name is already set by getDescriptorByRef or getDescriptor function depending on the type. Only prefix, if present is needed to be set here | https://github.com/swagger-api/swagger-ui/issues/2577
|
||||
this.name = getPrefix(name, definition.xml);
|
||||
this.definition = definition;
|
||||
this.models = models;
|
||||
this.type = type;
|
||||
@@ -917,8 +935,15 @@ SwaggerUi.partials.signature = (function () {
|
||||
var modelType = simpleRef($ref);
|
||||
var model = models[modelType] || {};
|
||||
var type = model.definition && model.definition.type ? model.definition.type : 'object';
|
||||
name = name || model.name;
|
||||
|
||||
// If model definition xml name is present, then that will be preferred over model name. This is the case of preferring XmlElement name over XmlRootElement name if XmlElement name is provided | https://github.com/swagger-api/swagger-ui/issues/2577
|
||||
if(model.definition && model.definition.xml && model.definition.xml.name) {
|
||||
name = name || model.definition.xml.name || model.name;
|
||||
}
|
||||
// else only model name will be considered for determination | https://github.com/swagger-api/swagger-ui/issues/2577
|
||||
else {
|
||||
name = name || model.name;
|
||||
}
|
||||
|
||||
if (config.modelsToIgnore.indexOf($ref) > -1) {
|
||||
type = 'loop';
|
||||
config.loopTo = modelType;
|
||||
@@ -929,13 +954,15 @@ SwaggerUi.partials.signature = (function () {
|
||||
if (!model.definition) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return new Descriptor(name, type, model.definition, models, config);
|
||||
return new Descriptor(name, type, model.definition, models, config);
|
||||
}
|
||||
|
||||
function getDescriptor (name, definition, models, config){
|
||||
var type = definition.type || 'object';
|
||||
|
||||
// If definition xml name is present, then that will be preferred over name | https://github.com/swagger-api/swagger-ui/issues/2577
|
||||
if(definition.xml && definition.xml.name) {
|
||||
name = definition.xml.name || name;
|
||||
}
|
||||
if (!definition) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -201,4 +201,9 @@
|
||||
}
|
||||
|
||||
.api-popup-actions { padding-top: 10px; }
|
||||
|
||||
fieldset {
|
||||
padding-bottom: 10px;
|
||||
padding-left: 20px;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -250,7 +250,8 @@
|
||||
font-size: .85em;
|
||||
line-height: 1.2em;
|
||||
overflow: auto;
|
||||
max-height: 200px;
|
||||
height: 200px;
|
||||
resize: vertical;
|
||||
cursor: pointer;
|
||||
}
|
||||
ul.signature-nav {
|
||||
@@ -708,6 +709,11 @@
|
||||
padding: 0;
|
||||
line-height: inherit;
|
||||
}
|
||||
.nickname {
|
||||
color: #aaaaaa;
|
||||
padding: 0;
|
||||
line-height: inherit;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
font-size: 1.5em;
|
||||
font-weight: bold;
|
||||
text-decoration: none;
|
||||
background: transparent url(../images/logo.png) no-repeat left center;
|
||||
padding: 20px 0 20px 40px;
|
||||
}
|
||||
|
||||
@@ -84,7 +83,6 @@
|
||||
width: 1500px;
|
||||
margin: auto;
|
||||
margin-top: 0;
|
||||
background-image: url('../images/shield.png');
|
||||
background-repeat: no-repeat;
|
||||
background-position: -40px -20px;
|
||||
margin-bottom: 210px;
|
||||
|
||||
@@ -1,12 +1,36 @@
|
||||
<div>
|
||||
<h3 class="auth__title">Select OAuth2.0 Scopes</h3>
|
||||
<h3 class="auth__title">OAuth2.0</h3>
|
||||
<p>{{{sanitize description}}}</p>
|
||||
{{#if authorizationUrl}}<p>Authorization URL: {{{sanitize authorizationUrl}}}</p>{{/if}}
|
||||
{{#if tokenUrl}}<p>Token URL: {{{sanitize tokenUrl}}}</p>{{/if}}
|
||||
<p>flow: {{{escape flow}}}</p>
|
||||
{{#if isPasswordFlow}}
|
||||
<p>Please input username and password for password flow authorization</p>
|
||||
<fieldset>
|
||||
<div><label>Username: <input class="oauth-username" type="text" name="username"></label></div>
|
||||
<div><label>Password: <input class="oauth-password" type="password" name="password"></label></div>
|
||||
</fieldset>
|
||||
{{/if}}
|
||||
{{#if clientAuthentication}}
|
||||
<p>Setup client authentication.{{#if requireClientAuthenticaiton}}(Required){{/if}}</p>
|
||||
<fieldset>
|
||||
<div><label>Type:
|
||||
<select class="oauth-client-authentication-type" name="client-authentication-type">
|
||||
<option value="none" selected>None or other</option>
|
||||
<option value="basic">Basic auth</option>
|
||||
<option value="request-body">Request body</option>
|
||||
</select>
|
||||
</label></div>
|
||||
<div class="oauth-client-authentication" hidden>
|
||||
<div><label>ClientId: <input class="oauth-client-id" type="text" name="client-id"></label></div>
|
||||
<div><label>Secret: <input class="oauth-client-secret" type="text" name="client-secret"></label></div>
|
||||
</div>
|
||||
</fieldset>
|
||||
{{/if}}
|
||||
<p><strong> {{{escape appName}}} </strong> API requires the following scopes. Select which ones you want to grant to Swagger UI.</p>
|
||||
<p>Scopes are used to grant an application different levels of access to data on behalf of the end user. Each API may declare one or more scopes.
|
||||
<a href="#">Learn how to use</a>
|
||||
</p>
|
||||
<p><strong> {{{escape appName}}} </strong> API requires the following scopes. Select which ones you want to grant to Swagger UI.</p>
|
||||
<p>Authorization URL: {{{sanitize authorizationUrl}}}</p>
|
||||
<p>flow: {{{escape flow}}}</p>
|
||||
<ul class="api-popup-scopes">
|
||||
{{#each scopes}}
|
||||
<li>
|
||||
|
||||
@@ -10,6 +10,11 @@
|
||||
</span>
|
||||
</h3>
|
||||
<ul class='options'>
|
||||
{{#if showOperationIds}}
|
||||
<li>
|
||||
<a href='#!/{{sanitize encodedParentId}}/{{sanitize nickname}}' class="toggleOperation"><span class="nickname">{{{escape nickname}}}()</span></a>
|
||||
</li>
|
||||
{{/if}}
|
||||
<li>
|
||||
<a href='#!/{{sanitize encodedParentId}}/{{sanitize nickname}}' class="toggleOperation"><span class="markdown">{{{escape summary}}}</span></a>
|
||||
</li>
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
{{/if}}
|
||||
{{else}}
|
||||
{{#if isFile}}
|
||||
<input class='parameter' class='required' type='file' name='{{{sanitize name}}}' id='{{{escape valueId}}}'/>
|
||||
<input class='parameter required' type='file' name='{{{sanitize name}}}' id='{{{escape valueId}}}'/>
|
||||
{{else}}
|
||||
{{#renderTextParam this}}
|
||||
{{/renderTextParam}}
|
||||
|
||||
@@ -212,6 +212,28 @@ templates['main'] = template({"1":function(container,depth0,helpers,partials,dat
|
||||
+ " </h4>\n </div>\n</div>\n";
|
||||
},"useData":true});
|
||||
templates['oauth2'] = template({"1":function(container,depth0,helpers,partials,data) {
|
||||
var stack1;
|
||||
|
||||
return "<p>Authorization URL: "
|
||||
+ ((stack1 = (helpers.sanitize || (depth0 && depth0.sanitize) || helpers.helperMissing).call(depth0 != null ? depth0 : {},(depth0 != null ? depth0.authorizationUrl : depth0),{"name":"sanitize","hash":{},"data":data})) != null ? stack1 : "")
|
||||
+ "</p>";
|
||||
},"3":function(container,depth0,helpers,partials,data) {
|
||||
var stack1;
|
||||
|
||||
return "<p>Token URL: "
|
||||
+ ((stack1 = (helpers.sanitize || (depth0 && depth0.sanitize) || helpers.helperMissing).call(depth0 != null ? depth0 : {},(depth0 != null ? depth0.tokenUrl : depth0),{"name":"sanitize","hash":{},"data":data})) != null ? stack1 : "")
|
||||
+ "</p>";
|
||||
},"5":function(container,depth0,helpers,partials,data) {
|
||||
return " <p>Please input username and password for password flow authorization</p>\n <fieldset>\n <div><label>Username: <input class=\"oauth-username\" type=\"text\" name=\"username\"></label></div>\n <div><label>Password: <input class=\"oauth-password\" type=\"password\" name=\"password\"></label></div>\n </fieldset>\n";
|
||||
},"7":function(container,depth0,helpers,partials,data) {
|
||||
var stack1;
|
||||
|
||||
return " <p>Setup client authentication."
|
||||
+ ((stack1 = helpers["if"].call(depth0 != null ? depth0 : {},(depth0 != null ? depth0.requireClientAuthenticaiton : depth0),{"name":"if","hash":{},"fn":container.program(8, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
|
||||
+ "</p>\n <fieldset>\n <div><label>Type:\n <select class=\"oauth-client-authentication-type\" name=\"client-authentication-type\">\n <option value=\"none\" selected>None or other</option>\n <option value=\"basic\">Basic auth</option>\n <option value=\"request-body\">Request body</option>\n </select>\n </label></div>\n <div class=\"oauth-client-authentication\" hidden>\n <div><label>ClientId: <input class=\"oauth-client-id\" type=\"text\" name=\"client-id\"></label></div>\n <div><label>Secret: <input class=\"oauth-client-secret\" type=\"text\" name=\"client-secret\"></label></div>\n </div>\n </fieldset>\n";
|
||||
},"8":function(container,depth0,helpers,partials,data) {
|
||||
return "(Required)";
|
||||
},"10":function(container,depth0,helpers,partials,data) {
|
||||
var stack1, alias1=depth0 != null ? depth0 : {}, alias2=helpers.helperMissing;
|
||||
|
||||
return " <li>\n <input class=\"oauth-scope\" type=\"checkbox\" data-scope=\""
|
||||
@@ -223,9 +245,9 @@ templates['oauth2'] = template({"1":function(container,depth0,helpers,partials,d
|
||||
+ "</label><br/>\n <span class=\"api-scope-desc\">"
|
||||
+ ((stack1 = (helpers.escape || (depth0 && depth0.escape) || alias2).call(alias1,(depth0 != null ? depth0.description : depth0),{"name":"escape","hash":{},"data":data})) != null ? stack1 : "")
|
||||
+ "\n"
|
||||
+ ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.OAuthSchemeKey : depth0),{"name":"if","hash":{},"fn":container.program(2, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
|
||||
+ ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.OAuthSchemeKey : depth0),{"name":"if","hash":{},"fn":container.program(11, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
|
||||
+ " </span>\n </li>\n";
|
||||
},"2":function(container,depth0,helpers,partials,data) {
|
||||
},"11":function(container,depth0,helpers,partials,data) {
|
||||
var stack1;
|
||||
|
||||
return " ("
|
||||
@@ -234,16 +256,21 @@ templates['oauth2'] = template({"1":function(container,depth0,helpers,partials,d
|
||||
},"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) {
|
||||
var stack1, alias1=depth0 != null ? depth0 : {}, alias2=helpers.helperMissing;
|
||||
|
||||
return "<div>\n <h3 class=\"auth__title\">Select OAuth2.0 Scopes</h3>\n <p>"
|
||||
return "<div>\n <h3 class=\"auth__title\">OAuth2.0</h3>\n <p>"
|
||||
+ ((stack1 = (helpers.sanitize || (depth0 && depth0.sanitize) || alias2).call(alias1,(depth0 != null ? depth0.description : depth0),{"name":"sanitize","hash":{},"data":data})) != null ? stack1 : "")
|
||||
+ "</p>\n <p>Scopes are used to grant an application different levels of access to data on behalf of the end user. Each API may declare one or more scopes.\n <a href=\"#\">Learn how to use</a>\n </p>\n <p><strong> "
|
||||
+ ((stack1 = (helpers.escape || (depth0 && depth0.escape) || alias2).call(alias1,(depth0 != null ? depth0.appName : depth0),{"name":"escape","hash":{},"data":data})) != null ? stack1 : "")
|
||||
+ " </strong> API requires the following scopes. Select which ones you want to grant to Swagger UI.</p>\n <p>Authorization URL: "
|
||||
+ ((stack1 = (helpers.sanitize || (depth0 && depth0.sanitize) || alias2).call(alias1,(depth0 != null ? depth0.authorizationUrl : depth0),{"name":"sanitize","hash":{},"data":data})) != null ? stack1 : "")
|
||||
+ "</p>\n <p>flow: "
|
||||
+ "</p>\n "
|
||||
+ ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.authorizationUrl : depth0),{"name":"if","hash":{},"fn":container.program(1, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
|
||||
+ "\n "
|
||||
+ ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.tokenUrl : depth0),{"name":"if","hash":{},"fn":container.program(3, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
|
||||
+ "\n <p>flow: "
|
||||
+ ((stack1 = (helpers.escape || (depth0 && depth0.escape) || alias2).call(alias1,(depth0 != null ? depth0.flow : depth0),{"name":"escape","hash":{},"data":data})) != null ? stack1 : "")
|
||||
+ "</p>\n <ul class=\"api-popup-scopes\">\n"
|
||||
+ ((stack1 = helpers.each.call(alias1,(depth0 != null ? depth0.scopes : depth0),{"name":"each","hash":{},"fn":container.program(1, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
|
||||
+ "</p>\n"
|
||||
+ ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.isPasswordFlow : depth0),{"name":"if","hash":{},"fn":container.program(5, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
|
||||
+ ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.clientAuthentication : depth0),{"name":"if","hash":{},"fn":container.program(7, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
|
||||
+ " <p><strong> "
|
||||
+ ((stack1 = (helpers.escape || (depth0 && depth0.escape) || alias2).call(alias1,(depth0 != null ? depth0.appName : depth0),{"name":"escape","hash":{},"data":data})) != null ? stack1 : "")
|
||||
+ " </strong> API requires the following scopes. Select which ones you want to grant to Swagger UI.</p>\n <p>Scopes are used to grant an application different levels of access to data on behalf of the end user. Each API may declare one or more scopes.\n <a href=\"#\">Learn how to use</a>\n </p>\n <ul class=\"api-popup-scopes\">\n"
|
||||
+ ((stack1 = helpers.each.call(alias1,(depth0 != null ? depth0.scopes : depth0),{"name":"each","hash":{},"fn":container.program(10, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
|
||||
+ " </ul>\n</div>";
|
||||
},"useData":true});
|
||||
templates['operation'] = template({"1":function(container,depth0,helpers,partials,data) {
|
||||
@@ -585,7 +612,7 @@ templates['param_required'] = template({"1":function(container,depth0,helpers,pa
|
||||
},"10":function(container,depth0,helpers,partials,data) {
|
||||
var stack1, alias1=depth0 != null ? depth0 : {}, alias2=helpers.helperMissing;
|
||||
|
||||
return " <input class='parameter' class='required' type='file' name='"
|
||||
return " <input class='parameter required' type='file' name='"
|
||||
+ ((stack1 = (helpers.sanitize || (depth0 && depth0.sanitize) || alias2).call(alias1,(depth0 != null ? depth0.name : depth0),{"name":"sanitize","hash":{},"data":data})) != null ? stack1 : "")
|
||||
+ "' id='"
|
||||
+ ((stack1 = (helpers.escape || (depth0 && depth0.escape) || alias2).call(alias1,(depth0 != null ? depth0.valueId : depth0),{"name":"escape","hash":{},"data":data})) != null ? stack1 : "")
|
||||
|
||||
Reference in New Issue
Block a user