Compare commits

..
108 Commits
Author SHA1 Message Date
Tony Tam 8bc259558b updated build 2015-09-19 11:58:10 -07:00
Tony Tam 9bf8129058 Merge pull request #1607 from safinalexey/master
fix for angular apps, when you dont have proper route and clicking on…
2015-09-19 11:51:19 -07:00
Tony Tam 49afcc8b02 Merge branch 'ezburg-master' 2015-09-19 11:49:06 -07:00
Tony Tam bee68dd7c5 Merge branch 'master' of https://github.com/ezburg/swagger-ui into ezburg-master 2015-09-19 11:48:58 -07:00
Tony Tam 1c6073ce2e Merge pull request #1612 from swagger-api/client-update
updated client version, rebuilt
2015-09-19 11:48:36 -07:00
Tony Tam 20b0dde184 updated timeouts 2015-09-19 11:36:40 -07:00
Tony Tam f6f8e74586 Update v1.js 2015-09-19 10:39:16 -07:00
Tony Tam 4efefb156a Update v2.js 2015-09-19 10:39:01 -07:00
Tony Tam 058f959669 extended timeouts 2015-09-19 09:51:23 -07:00
Tony Tam 22654e2180 unset sudo 2015-09-19 09:43:03 -07:00
Tony Tam 8930cbb6dc updated client version, rebuilt 2015-09-19 09:08:58 -07:00
Hans Zhang d14f153014 Create zh-cn.js 2015-09-19 17:03:10 +02:00
Hans Zhang e60b195c46 Create zh-cn.js 2015-09-19 17:02:23 +02:00
Tony Tam 66b574c220 Merge pull request #1599 from toke/master
Prevent screwed up layout on long Content-Types
2015-09-17 06:25:47 -07:00
Tony Tam 5f387dd2a5 Merge pull request #1604 from swagger-api/client-update
updated client
2015-09-16 10:45:52 -07:00
safin 16cfce4c20 fix for angular apps, when you dont have proper route and clicking on header leads to 'othewise' branch of router 2015-09-16 18:48:53 +03:00
Tony Tam 1f74d9fac4 updated client 2015-09-15 23:38:46 -07:00
Thomas Kerpe 40c732c087 Prevent screwed up layout on long Content-Types
Some Content-Types (especially Vendor specific Content-Types)
can be rather long. This breaks the layout so prevent
rendering too wide select boxes by default.
2015-09-15 17:00:42 +02:00
Thomas Kerpe 4e6669d63f Merge branch 'master' of github.com:toke/swagger-ui 2015-09-15 16:22:11 +02:00
Thomas Kerpe 84337d5a0b Prevent screwed up layout on long Content-Types
Some Content-Types (especially Vendor specific Content-Types)
can be rather long. This breaks the layout so prevent
rendering too wide select boxes by default.
2015-09-15 16:19:18 +02:00
Tony Tam 736e7cd90e Merge pull request #1560 from gorfik/1350
fix for issue 1350
2015-08-25 12:40:19 -07:00
Mariusz Lewicki 529705afce fix for issue 1350 2015-08-25 21:25:32 +02:00
Tony Tam 93b7da1fa0 Merge pull request #1559 from muzir/patch-1
Create tr.js
2015-08-25 12:20:57 -07:00
erhun e557210f1e Create tr.js
I added turkish language support for swagger index.html. I use this file in my project too.  https://github.com/muzir/azorka.web/blob/master/src/main/webapp/resources/dist/lang/tr.js
2015-08-25 22:17:24 +03:00
Tony Tam 8076ff1462 Merge pull request #1553 from swagger-api/issue-1552
updated client for #1552
2015-08-19 22:51:22 -07:00
Tony Tam ec446fd7f3 updated client from #1552 2015-08-19 22:44:54 -07:00
Tony Tam daa45c4efb Merge pull request #1528 from sloppycoder/master
fix for issue #1516: OAuth logout doesn't work
2015-08-11 10:57:29 -07:00
Li Lin 00a5e4d838 fix for issue #1516: OAuth logout doesn't work 2015-08-11 16:38:03 +08:00
Ron 59c10037f5 Update README.md 2015-08-07 09:59:19 -04:00
Ron 73bdb71f3e Update README.md 2015-08-07 09:58:41 -04:00
Ron a27bbfad6a Update CONTRIBUTING.md 2015-08-07 09:55:28 -04:00
Ron d9ac809b51 Merge pull request #1520 from swagger-api/develop_2.0
Moving to development on master
2015-08-07 09:54:29 -04:00
Tony Tam 04e52d4a63 Merge pull request #1519 from strongloop/upstream-fix/test-timings
Fix timing issues in unit-tests
2015-08-06 17:15:50 -07:00
Tony Tam 7f5d9dc200 Merge pull request #1512 from channelgrabber/issue-1423
Issue #1423: $ref schema objects in Responses Definitions Object don't seem to be displayed correctly
2015-08-06 17:15:32 -07:00
Miroslav Bajtoš f6d7b6a73f Fix timing issues in unit-tests 2015-08-06 17:22:52 +02:00
Aaron Baker ed41c336a3 Issue #1423: responses containing references to definitions were not being fully resolved when the spec was pulled in over AJAX but was working locally. OperationView.render()'s parsing of the responses was just checking if the ref _started_ with '#/definitions/', not whether it contained it, and when pulled in over AJAX the refs have the URL prepended to them 2015-08-05 12:48:34 +01:00
Tony Tam 8e72906c91 Merge pull request #1487 from swagger-api/develop_2.0
Prepare for release
2015-07-22 21:29:59 -07:00
Tony Tam c7c697206e updated versions 2015-07-22 21:26:53 -07:00
Tony Tam 190b47501b Merge pull request #1486 from rest4hub/develop_2.0
Missing some data-sw-translation
2015-07-22 21:22:29 -07:00
Francisco Guimarães a351df7e5e Missing "Headers" translation 2015-07-23 01:17:52 -03:00
Francisco Guimarães 4d05e63bab Missing "Headers" translation 2015-07-23 01:15:23 -03:00
Francisco Guimarães 675b6c5c77 Fix merge 2015-07-23 01:06:40 -03:00
Francisco Guimarães 04a3fd4c81 Missing some data-sw-translation 2015-07-23 01:03:41 -03:00
Francisco Guimarães 49f9b15df5 dist 2015-07-23 00:59:38 -03:00
Francisco Guimarães eb50137901 Missing some data-sw-translation at templates 2015-07-23 00:56:22 -03:00
Francisco Guimarães 1456015b03 Build 2015-07-23 00:17:10 -03:00
Francisco Guimarães ec7ecbd543 Missing some data-sw-translation at templates 2015-07-23 00:11:12 -03:00
Francisco Guimarães bc4b43a7d3 merged from swagger-api 2015-07-23 00:02:14 -03:00
Francisco Guimarães 2a75f039e8 missing some data-sw-translation 2015-07-22 23:48:41 -03:00
Tony Tam 6b66af78f9 Merge branch 'rest4hub-develop_2.0' into develop_2.0 2015-07-22 18:21:21 -07:00
Tony Tam b1d0918955 merged 2015-07-22 18:21:14 -07:00
Tony Tam 83afb5b277 rebuilt 2015-07-22 18:19:27 -07:00
Tony Tam 840ec906f1 Merge branch 'tkatkov-develop_2.0' into develop_2.0 2015-07-22 18:14:26 -07:00
Tony Tam 996433d8bc merged 2015-07-22 18:14:18 -07:00
Tony Tam 958e74875f Merge pull request #1427 from lucian303/fix-validator-https-detection
Fix validator's https detection
2015-07-22 18:13:20 -07:00
Tony Tam 5195447df6 Merge pull request #1419 from lucian303/oauth-client-secret
Add support for oauth client secret when calling the token URL. Fixes #1384. Fixes #1324.
2015-07-22 18:12:39 -07:00
Tony Tam 139841f623 Merge pull request #1484 from swagger-api/revert-1417-master
Revert "Updating documentation based on issue swagger-ui issue #1414"
2015-07-22 18:09:07 -07:00
Tony Tam 3abf835168 Revert "Updating documentation based on issue swagger-ui issue #1414" 2015-07-22 18:08:56 -07:00
Tony Tam 015f1a1dce Merge pull request #1417 from watchwithmike/master
Updating documentation based on issue swagger-ui issue #1414
2015-07-22 18:08:36 -07:00
Tony Tam f0e7de25ff Merge pull request #1407 from Collaborne/improvements/npm-license-spdx-warning
Use a SPDX-compatible identifier for the 'license' value
2015-07-22 18:06:23 -07:00
Tony Tam fd57e34393 Merge branch '3scale-data-vendor-extension' into develop_2.0 2015-07-22 18:06:01 -07:00
Tony Tam b909e2adda merged 2015-07-22 18:05:52 -07:00
Tony Tam f1a7b2cea8 Merge pull request #1395 from praseetht/master
Fix #1394: A bug in IE 10/11 causes the placeholder text to be copied to value
2015-07-22 18:03:32 -07:00
Tony Tam d91959f473 Merge branch 'darklynx-apikey_template_fix' into develop_2.0 2015-07-22 18:03:04 -07:00
Tony Tam c477a69d06 merged 2015-07-22 18:02:57 -07:00
Tony Tam 34e4a68da8 Merge pull request #1389 from bigtlb/develop_2.0
OAuth flow only selected scopes should be sent to Authorize endpoint #1388.
2015-07-22 18:00:08 -07:00
Tony Tam 29dc4b929d Merge pull request #1387 from brownstein/fix-oauth-toggle-on-operations
Fix incorrect display of oAuth toggle in non-oAuth operation views
2015-07-22 17:59:55 -07:00
Tony Tam e05afd8a4b Merge pull request #1375 from ponelat/fix/translator
Fix/translator
2015-07-22 17:59:24 -07:00
Tony Tam ac811a7aa0 Merge pull request #1371 from ipeluffo/lang-es
Spanish language translation
2015-07-22 17:58:39 -07:00
Tony Tam ee721c400d merged to develop_2.0 2015-07-22 17:57:51 -07:00
Tony Tam dc6a81275e Merge branch 'oauth_tooltip_fix' of ssh://github.com/darklynx/swagger-ui into darklynx-oauth_tooltip_fix 2015-07-22 17:56:15 -07:00
Tony Tam 102cf0a896 Merge pull request #1360 from kkirsche/patch-2
Remove moot `version` property from bower.json dev branch
2015-07-22 17:55:51 -07:00
Francisco Guimarães ade1185961 Changes at src 2015-07-22 02:12:44 -03:00
Francisco Guimarães 44a434a9fe Translation 2015-07-20 23:21:26 -03:00
Francisco Guimarães fb6855b212 Include pt translation 2015-07-20 23:18:10 -03:00
Francisco Guimarães fb42d355c8 Move pt to dist 2015-07-20 22:58:56 -03:00
Francisco Guimarães 566bc84265 Move to dist 2015-07-20 22:57:12 -03:00
Francisco Guimarães d5216e3469 PT localization 2015-07-20 22:48:24 -03:00
sonicd300 66a049c664 Added built files 2015-07-17 10:36:32 -05:00
sonicd300 379609bb70 Added flexible scope separator 2015-07-16 15:18:08 -05:00
Taras Katkov a04b562f55 Spelling and closing tag fixes 2015-07-01 17:55:19 -04:00
Lucian Hontau 52aaf874d8 Fix value for window.location.protocol. 2015-06-26 16:26:38 -04:00
Lucian Hontau 1fd15c6b34 Add support for oauth client secret when calling the token URL. Fixes #1384. Fixes #1324. 2015-06-25 17:57:29 -04:00
Mike Dalrymple a1ac2b755a Updating documentation based on issue swagger-ui issue #1414 2015-06-25 13:55:24 -07:00
Ron 59459a6086 Merge pull request #1408 from Collaborne/bugs/contributing-typo
Improve the language in CONTRIBUTING.md
2015-06-24 12:10:33 +03:00
Andreas Kohn d04833d994 Improve the language in CONTRIBUTING.md 2015-06-24 11:08:27 +02:00
Andreas Kohn 9d725f1440 Use a SPDX-compatible identifier for the 'license' value
This fixes the warning issued at `npm install` time.
2015-06-24 11:04:14 +02:00
aurelian 25a9035014 regenerated 2015-06-22 16:26:42 +02:00
aurelian 554302f49d ignore case. 2015-06-22 16:26:32 +02:00
aurelian a7aa7b2215 regenerated 2015-06-22 14:51:36 +02:00
aurelian e475bb908e X-data-* vendor extension for parameter objects
Exposes X-data- as html data attributes for parameter objects

See comment in #991
2015-06-22 14:48:21 +02:00
Praseeth T 6d4bc72a64 Fix #1394: A bug in IE 10/11 causes the placeholder text to be copied to "value" 2015-06-21 11:37:29 +05:30
Vladimir L 791e2951ef removed superfluous quote 2015-06-19 23:55:10 +02:00
Tom Baker 340da086ba OAuth flow only selected scopes should be sent to Authorize endpoint #1388.
Need to clear out previous popupDialog nodes, so previous checkboxes won't be considered.
2015-06-19 13:30:20 -05:00
Robert Brownstein 128fc5c112 Found a bug in OperationView.js which caused the oAuth toggle to be displayed for non-oAuth endpoints if oAuth was enabled at all, fixed it 2015-06-19 13:37:54 -04:00
Ron eefec8db0b Update README.md 2015-06-18 09:25:39 +03:00
Ron d75505fb73 Merge pull request #1379 from robrich/master
Spelling is hard
2015-06-18 09:24:54 +03:00
Rob Richardson 77fc1c0adf Spelling is hard 2015-06-17 17:16:14 -07:00
Josh Ponelat cb1896b252 fix lint issue 2015-06-16 12:44:48 +02:00
Josh Ponelat 44bc2eab56 build with translator support 2015-06-16 12:08:19 +02:00
Josh Ponelat c0c5847bd3 add lang to gulpfile 2015-06-16 12:07:23 +02:00
Josh Ponelat 372723b82d add data-sw-translate to templates 2015-06-16 12:06:49 +02:00
Ignacio Peluffo e7d179432f Translation to Spanish finished 2015-06-13 15:33:01 -03:00
ipeluffo f0f71dc343 Some words translation added 2015-06-13 15:22:29 -03:00
ipeluffo 9702e3c280 Spanish translation added 2015-06-13 15:19:11 -03:00
Vladimir L eaaf62a01e removed unnesessary logic, replaced by CSS style 2015-06-11 21:26:30 +02:00
Vladimir L 695dcc16b1 fixed issue with OAuth hint 2015-06-11 21:21:37 +02:00
Kevin Kirsche 32fd6a3cd4 Remove moot version property from bower.json dev branch
Per bower/bower.json-spec@a325da3
2015-06-10 21:06:50 -04:00
47 changed files with 2328 additions and 1545 deletions
-4
View File
@@ -1,7 +1,3 @@
## Pull Requests
Plase make your pull requests are made to the [**`develop_2.0`**](https://github.com/swagger-api/swagger-ui/tree/develop_2.0) branch at this time.
## Issues
SwaggerUI uses [SwaggerJS](https://github.com/swagger-api/swagger-js) library for many internal operations. If you see errors in
[`swagger-client.js`](lib/swagger-client.js) file, you should probably open the issue in [SwaggerJS](https://github.com/swagger-api/swagger-js) repository.
+2 -2
View File
@@ -20,7 +20,7 @@ The Swagger Specification has undergone 4 revisions since initial creation in 20
Swagger UI Version | Release Date | Swagger Spec compatibility | Notes | Status
------------------ | ------------ | -------------------------- | ----- | ------
2.1.1 | 2015-06-06 | 1.1, 1.2, 2.0 | [master](https://github.com/swagger-api/swagger-ui) |
2.1.1 | 2015-07-23 | 1.1, 1.2, 2.0 | [tag v.2.1.1](https://github.com/swagger-api/swagger-ui/tree/v2.1.1) |
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) |
1.0.1 | 2011-10-11 | 1.0, 1.1 | [tag v1.0.1](https://github.com/swagger-api/swagger-ui/tree/v1.0.1) |
@@ -225,7 +225,7 @@ Create your own fork of [swagger-api/swagger-ui](https://github.com/swagger-api/
To share your changes, [submit a pull request](https://github.com/swagger-api/swagger-ui/pull/new/develop_2.0).
## Change Log
Plsee see [releases](https://github.com/swagger-api/swagger-ui/releases) for change log.
Please see [releases](https://github.com/swagger-api/swagger-ui/releases) for change log.
## License
-1
View File
@@ -1,7 +1,6 @@
{
"name": "swagger-ui",
"main": "dist/index.html",
"version": "2.1.0",
"authors": [
"Mohsen Azimi <me@azimi.me>"
],
+3
View File
@@ -807,6 +807,9 @@
outline: 2px solid black;
outline-color: #cc0000;
}
.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content form select[name='parameterContentType'] {
max-width: 300px;
}
.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content div.response div.block pre {
font-family: "Anonymous Pro", "Menlo", "Consolas", "Bitstream Vera Sans Mono", "Courier New", monospace;
padding: 10px;
+21 -12
View File
@@ -807,6 +807,9 @@
outline: 2px solid black;
outline-color: #cc0000;
}
.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content form select[name='parameterContentType'] {
max-width: 300px;
}
.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content div.response div.block pre {
font-family: "Anonymous Pro", "Menlo", "Consolas", "Bitstream Vera Sans Mono", "Courier New", monospace;
padding: 10px;
@@ -1155,8 +1158,16 @@
.swagger-section .auth {
float: right;
}
.swagger-section #api_information_panel {
position: absolute;
.swagger-section .api-ic {
height: 18px;
vertical-align: middle;
display: inline-block;
background: url(../images/explorer_icons.png) no-repeat;
}
.swagger-section .api-ic .api_information_panel {
position: relative;
margin-top: 20px;
margin-left: -5px;
background: #FFF;
border: 1px solid #ccc;
border-radius: 5px;
@@ -1167,34 +1178,32 @@
color: black;
padding: 5px;
}
.swagger-section #api_information_panel p .api-msg-enabled {
.swagger-section .api-ic .api_information_panel p .api-msg-enabled {
color: green;
}
.swagger-section #api_information_panel p .api-msg-disabled {
.swagger-section .api-ic .api_information_panel p .api-msg-disabled {
color: red;
}
.swagger-section .api-ic {
height: 18px;
vertical-align: middle;
display: inline-block;
background: url(../images/explorer_icons.png) no-repeat;
.swagger-section .api-ic:hover .api_information_panel {
position: absolute;
display: block;
}
.swagger-section .ic-info {
background-position: 0 0;
width: 18px;
margin-top: -7px;
margin-top: -6px;
margin-left: 4px;
}
.swagger-section .ic-warning {
background-position: -60px 0;
width: 18px;
margin-top: -7px;
margin-top: -6px;
margin-left: 4px;
}
.swagger-section .ic-error {
background-position: -30px 0;
width: 18px;
margin-top: -7px;
margin-top: -6px;
margin-left: 4px;
}
.swagger-section .ic-off {
+20 -3
View File
@@ -1,6 +1,7 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<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" />
@@ -21,6 +22,11 @@
<script src='lib/marked.js' type='text/javascript'></script>
<script src='lib/swagger-oauth.js' type='text/javascript'></script>
<!-- Some basic translations -->
<!-- <script src='lang/translator.js' type='text/javascript'></script> -->
<!-- <script src='lang/ru.js' type='text/javascript'></script> -->
<!-- <script src='lang/en.js' type='text/javascript'></script> -->
<script type="text/javascript">
$(function () {
var url = window.location.search.match(/url=([^&]+)/);
@@ -29,6 +35,11 @@
} else {
url = "http://petstore.swagger.io/v2/swagger.json";
}
// Pre load translate...
if(window.SwaggerTranslator) {
window.SwaggerTranslator.translate();
}
window.swaggerUi = new SwaggerUi({
url: url,
dom_id: "swagger-ui-container",
@@ -37,11 +48,17 @@
if(typeof initOAuth == "function") {
initOAuth({
clientId: "your-client-id",
clientSecret: "your-client-secret",
realm: "your-realms",
appName: "your-app-name"
appName: "your-app-name",
scopeSeparator: ","
});
}
if(window.SwaggerTranslator) {
window.SwaggerTranslator.translate();
}
$('pre code').each(function(i, e) {
hljs.highlightBlock(e)
});
@@ -91,12 +108,12 @@
<form id='api_selector'>
<div class='input'><input placeholder="http://example.com/api" id="input_baseUrl" name="baseUrl" type="text"/></div>
<div class='input'><input placeholder="api_key" id="input_apiKey" name="apiKey" type="text"/></div>
<div class='input'><a id="explore" href="#">Explore</a></div>
<div class='input'><a id="explore" href="#" data-sw-translate>Explore</a></div>
</form>
</div>
</div>
<div id="message-bar" class="swagger-ui-wrap">&nbsp;</div>
<div id="message-bar" class="swagger-ui-wrap" data-sw-translate>&nbsp;</div>
<div id="swagger-ui-container" class="swagger-ui-wrap"></div>
</body>
</html>
+53
View File
@@ -0,0 +1,53 @@
'use strict';
/* jshint quotmark: double */
window.SwaggerTranslator.learn({
"Warning: Deprecated":"Warning: Deprecated",
"Implementation Notes":"Implementation Notes",
"Response Class":"Response Class",
"Status":"Status",
"Parameters":"Parameters",
"Parameter":"Parameter",
"Value":"Value",
"Description":"Description",
"Parameter Type":"Parameter Type",
"Data Type":"Data Type",
"Response Messages":"Response Messages",
"HTTP Status Code":"HTTP Status Code",
"Reason":"Reason",
"Response Model":"Response Model",
"Request URL":"Request URL",
"Response Body":"Response Body",
"Response Code":"Response Code",
"Response Headers":"Response Headers",
"Hide Response":"Hide Response",
"Headers":"Headers",
"Try it out!":"Try it out!",
"Show/Hide":"Show/Hide",
"List Operations":"List Operations",
"Expand Operations":"Expand Operations",
"Raw":"Raw",
"can't parse JSON. Raw result":"can't parse JSON. Raw result",
"Model Schema":"Model Schema",
"Model":"Model",
"apply":"apply",
"Username":"Username",
"Password":"Password",
"Terms of service":"Terms of service",
"Created by":"Created by",
"See more at":"See more at",
"Contact the developer":"Contact the developer",
"api version":"api version",
"Response Content Type":"Response Content Type",
"fetching resource":"fetching resource",
"fetching resource list":"fetching resource list",
"Explore":"Explore",
"Show Swagger Petstore Example Apis":"Show Swagger Petstore Example Apis",
"Can't read from server. It may not have the appropriate access-control-origin settings.":"Can't read from server. It may not have the appropriate access-control-origin settings.",
"Please specify the protocol for":"Please specify the protocol for",
"Can't read swagger JSON from":"Can't read swagger JSON from",
"Finished Loading Resource Information. Rendering Swagger UI":"Finished Loading Resource Information. Rendering Swagger UI",
"Unable to read api":"Unable to read api",
"from path":"from path",
"server returned":"server returned"
});
+52
View File
@@ -0,0 +1,52 @@
'use strict';
/* jshint quotmark: double */
window.SwaggerTranslator.learn({
"Warning: Deprecated":"Advertencia: Obsoleto",
"Implementation Notes":"Notas de implementación",
"Response Class":"Clase de la Respuesta",
"Status":"Status",
"Parameters":"Parámetros",
"Parameter":"Parámetro",
"Value":"Valor",
"Description":"Descripción",
"Parameter Type":"Tipo del Parámetro",
"Data Type":"Tipo del Dato",
"Response Messages":"Mensajes de la Respuesta",
"HTTP Status Code":"Código de Status HTTP",
"Reason":"Razón",
"Response Model":"Modelo de la Respuesta",
"Request URL":"URL de la Solicitud",
"Response Body":"Cuerpo de la Respuesta",
"Response Code":"Código de la Respuesta",
"Response Headers":"Encabezados de la Respuesta",
"Hide Response":"Ocultar Respuesta",
"Try it out!":"Pruébalo!",
"Show/Hide":"Mostrar/Ocultar",
"List Operations":"Listar Operaciones",
"Expand Operations":"Expandir Operaciones",
"Raw":"Crudo",
"can't parse JSON. Raw result":"no puede parsear el JSON. Resultado crudo",
"Model Schema":"Esquema del Modelo",
"Model":"Modelo",
"apply":"aplicar",
"Username":"Nombre de usuario",
"Password":"Contraseña",
"Terms of service":"Términos de Servicio",
"Created by":"Creado por",
"See more at":"Ver más en",
"Contact the developer":"Contactar al desarrollador",
"api version":"versión de la api",
"Response Content Type":"Tipo de Contenido (Content Type) de la Respuesta",
"fetching resource":"buscando recurso",
"fetching resource list":"buscando lista del recurso",
"Explore":"Explorar",
"Show Swagger Petstore Example Apis":"Mostrar Api Ejemplo de Swagger Petstore",
"Can't read from server. It may not have the appropriate access-control-origin settings.":"No se puede leer del servidor. Tal vez no tiene la configuración de control de acceso de origen (access-control-origin) apropiado.",
"Please specify the protocol for":"Por favor, especificar el protocola para",
"Can't read swagger JSON from":"No se puede leer el JSON de swagger desde",
"Finished Loading Resource Information. Rendering Swagger UI":"Finalizada la carga del recurso de Información. Mostrando Swagger UI",
"Unable to read api":"No se puede leer la api",
"from path":"desde ruta",
"server returned":"el servidor retornó"
});
+53
View File
@@ -0,0 +1,53 @@
'use strict';
/* jshint quotmark: double */
window.SwaggerTranslator.learn({
"Warning: Deprecated":"Aviso: Depreciado",
"Implementation Notes":"Notas de Implementação",
"Response Class":"Classe de resposta",
"Status":"Status",
"Parameters":"Parâmetros",
"Parameter":"Parâmetro",
"Value":"Valor",
"Description":"Descrição",
"Parameter Type":"Tipo de parâmetro",
"Data Type":"Tipo de dados",
"Response Messages":"Mensagens de resposta",
"HTTP Status Code":"Código de status HTTP",
"Reason":"Razão",
"Response Model":"Modelo resposta",
"Request URL":"URL requisição",
"Response Body":"Corpo da resposta",
"Response Code":"Código da resposta",
"Response Headers":"Cabeçalho da resposta",
"Headers":"Cabeçalhos",
"Hide Response":"Esconder resposta",
"Try it out!":"Tente agora!",
"Show/Hide":"Mostrar/Esconder",
"List Operations":"Listar operações",
"Expand Operations":"Expandir operações",
"Raw":"Cru",
"can't parse JSON. Raw result":"Falha ao analisar JSON. Resulto cru",
"Model Schema":"Modelo esquema",
"Model":"Modelo",
"apply":"Aplicar",
"Username":"Usuário",
"Password":"Senha",
"Terms of service":"Termos do serviço",
"Created by":"Criado por",
"See more at":"Veja mais em",
"Contact the developer":"Contate o desenvolvedor",
"api version":"Versão api",
"Response Content Type":"Tipo de conteúdo da resposta",
"fetching resource":"busca recurso",
"fetching resource list":"buscando lista de recursos",
"Explore":"Explorar",
"Show Swagger Petstore Example Apis":"Show Swagger Petstore Example Apis",
"Can't read from server. It may not have the appropriate access-control-origin settings.":"Não é possível ler do servidor. Pode não ter as apropriadas configurações access-control-origin",
"Please specify the protocol for":"Por favor especifique o protocolo",
"Can't read swagger JSON from":"Não é possível ler o JSON Swagger de",
"Finished Loading Resource Information. Rendering Swagger UI":"Carregar informação de recurso finalizada. Renderizando Swagger UI",
"Unable to read api":"Não foi possível ler api",
"from path":"do caminho",
"server returned":"servidor retornou"
});
+52
View File
@@ -0,0 +1,52 @@
'use strict';
/* jshint quotmark: double */
window.SwaggerTranslator.learn({
"Warning: Deprecated":"Ворнинг: Депрекейтед",
"Implementation Notes":"Заметки",
"Response Class":"Пример ответа",
"Status":"Статус",
"Parameters":"Параметры",
"Parameter":"Параметр",
"Value":"Значение",
"Description":"Описание",
"Parameter Type":"Тип параметра",
"Data Type":"Тип данных",
"HTTP Status Code":"HTTP код",
"Reason":"Причина",
"Response Model":"Структура ответа",
"Request URL":"URL запроса",
"Response Body":"Тело ответа",
"Response Code":"HTTP код ответа",
"Response Headers":"Заголовки ответа",
"Hide Response":"Спрятать ответ",
"Response Messages":"Что может прийти в ответ",
"Try it out!":"Попробовать!",
"Show/Hide":"Показать/Скрыть",
"List Operations":"Операции кратко",
"Expand Operations":"Операции подробно",
"Raw":"В сыром виде",
"can't parse JSON. Raw result":"Не удается распарсить ответ:",
"Model Schema":"Структура",
"Model":"Описание",
"apply":"применить",
"Username":"Имя пользователя",
"Password":"Пароль",
"Terms of service":"Условия использования",
"Created by":"Разработано",
"See more at":"Еще тут",
"Contact the developer":"Связаться с разработчиком",
"api version":"Версия API",
"Response Content Type":"Content Type ответа",
"fetching resource":"Получение ресурса",
"fetching resource list":"Получение ресурсов",
"Explore":"Поехали",
"Show Swagger Petstore Example Apis":"Показать примеры АПИ",
"Can't read from server. It may not have the appropriate access-control-origin settings.":"Не удается получить ответ от сервера. Возможно, какая-то лажа с настройками доступа",
"Please specify the protocol for":"Пожалуйста, укажите протогол для",
"Can't read swagger JSON from":"Не получается прочитать swagger json из",
"Finished Loading Resource Information. Rendering Swagger UI":"Загрузка информации о ресурсах завершена. Рендерим",
"Unable to read api":"Не удалось прочитать api",
"from path":"по адресу",
"server returned":"сервер сказал"
});
+53
View File
@@ -0,0 +1,53 @@
'use strict';
/* jshint quotmark: double */
window.SwaggerTranslator.learn({
"Warning: Deprecated":"Uyarı: Deprecated",
"Implementation Notes":"Gerçekleştirim Notları",
"Response Class":"Dönen Sınıf",
"Status":"Statü",
"Parameters":"Parametreler",
"Parameter":"Parametre",
"Value":"Değer",
"Description":"Açıklama",
"Parameter Type":"Parametre Tipi",
"Data Type":"Veri Tipi",
"Response Messages":"Dönüş Mesajı",
"HTTP Status Code":"HTTP Statü Kodu",
"Reason":"Gerekçe",
"Response Model":"Dönüş Modeli",
"Request URL":"İstek URL",
"Response Body":"Dönüş İçeriği",
"Response Code":"Dönüş Kodu",
"Response Headers":"Dönüş Üst Bilgileri",
"Hide Response":"Dönüşü Gizle",
"Headers":"Üst Bilgiler",
"Try it out!":"Dene!",
"Show/Hide":"Göster/Gizle",
"List Operations":"Operasyonları Listele",
"Expand Operations":"Operasyonları Aç",
"Raw":"Ham",
"can't parse JSON. Raw result":"JSON çözümlenemiyor. Ham sonuç",
"Model Schema":"Model Şema",
"Model":"Model",
"apply":"uygula",
"Username":"Kullanıcı Adı",
"Password":"Parola",
"Terms of service":"Servis şartları",
"Created by":"Oluşturan",
"See more at":"Daha fazlası için",
"Contact the developer":"Geliştirici ile İletişime Geçin",
"api version":"api versiyon",
"Response Content Type":"Dönüş İçerik Tipi",
"fetching resource":"kaynak getiriliyor",
"fetching resource list":"kaynak listesi getiriliyor",
"Explore":"Keşfet",
"Show Swagger Petstore Example Apis":"Swagger Petstore Örnek Api'yi Gör",
"Can't read from server. It may not have the appropriate access-control-origin settings.":"Sunucudan okuma yapılamıyor. Sunucu access-control-origin ayarlarınızı kontrol edin.",
"Please specify the protocol for":"Lütfen istenen adres için protokol belirtiniz",
"Can't read swagger JSON from":"Swagger JSON bu kaynaktan okunamıyor",
"Finished Loading Resource Information. Rendering Swagger UI":"Kaynak baglantısı tamamlandı. Swagger UI gösterime hazırlanıyor",
"Unable to read api":"api okunamadı",
"from path":"yoldan",
"server returned":"sunucuya dönüldü"
});
+39
View File
@@ -0,0 +1,39 @@
'use strict';
/**
* Translator for documentation pages.
*
* To enable translation you should include one of language-files in your index.html
* after <script src='lang/translator.js' type='text/javascript'></script>.
* For example - <script src='lang/ru.js' type='text/javascript'></script>
*
* If you wish to translate some new texsts you should do two things:
* 1. Add a new phrase pair ("New Phrase": "New Translation") into your language file (for example lang/ru.js). It will be great if you add it in other language files too.
* 2. Mark that text it templates this way <anyHtmlTag data-sw-translate>New Phrase</anyHtmlTag> or <anyHtmlTag data-sw-translate value='New Phrase'/>.
* The main thing here is attribute data-sw-translate. Only inner html, title-attribute and value-attribute are going to translate.
*
*/
window.SwaggerTranslator = {
_words:[],
translate: function(sel) {
var $this = this;
sel = sel || '[data-sw-translate]';
$(sel).each(function() {
$(this).html($this._tryTranslate($(this).html()));
$(this).val($this._tryTranslate($(this).val()));
$(this).attr('title', $this._tryTranslate($(this).attr('title')));
});
},
_tryTranslate: function(word) {
return this._words[$.trim(word)] !== undefined ? this._words[$.trim(word)] : word;
},
learn: function(wordsMap) {
this._words = wordsMap;
}
};
+53
View File
@@ -0,0 +1,53 @@
'use strict';
/* jshint quotmark: double */
window.SwaggerTranslator.learn({
"Warning: Deprecated":"警告:已过时",
"Implementation Notes":"实现备注",
"Response Class":"响应类",
"Status":"状态",
"Parameters":"参数",
"Parameter":"参数",
"Value":"值",
"Description":"描述",
"Parameter Type":"参数类型",
"Data Type":"数据类型",
"Response Messages":"响应消息",
"HTTP Status Code":"HTTP状态码",
"Reason":"原因",
"Response Model":"响应模型",
"Request URL":"请求URL",
"Response Body":"响应体",
"Response Code":"响应码",
"Response Headers":"响应头",
"Hide Response":"隐藏响应",
"Headers":"头",
"Try it out!":"试一下!",
"Show/Hide":"显示/隐藏",
"List Operations":"显示操作",
"Expand Operations":"展开操作",
"Raw":"原始",
"can't parse JSON. Raw result":"无法解析JSON. 原始结果",
"Model Schema":"模型架构",
"Model":"模型",
"apply":"应用",
"Username":"用户名",
"Password":"密码",
"Terms of service":"服务条款",
"Created by":"创建者",
"See more at":"查看更多:",
"Contact the developer":"联系开发者",
"api version":"api版本",
"Response Content Type":"响应Content Type",
"fetching resource":"正在获取资源",
"fetching resource list":"正在获取资源列表",
"Explore":"浏览",
"Show Swagger Petstore Example Apis":"显示 Swagger Petstore 示例 Apis",
"Can't read from server. It may not have the appropriate access-control-origin settings.":"无法从服务器读取。可能没有正确设置access-control-origin。",
"Please specify the protocol for":"请指定协议:",
"Can't read swagger JSON from":"无法读取swagger JSON于",
"Finished Loading Resource Information. Rendering Swagger UI":"已加载资源信息。正在渲染Swagger UI",
"Unable to read api":"无法读取api",
"from path":"从路径",
"server returned":"服务器返回"
});
+12 -6
View File
@@ -5,6 +5,8 @@ var clientId;
var realm;
var oauth2KeyName;
var redirect_uri;
var clientSecret;
var scopeSeparator;
function handleLogin() {
var scopes = [];
@@ -40,6 +42,7 @@ function handleLogin() {
appName = window.swaggerUi.api.info.title;
}
$('.api-popup-dialog').remove();
popupDialog = $(
[
'<div class="api-popup-dialog">',
@@ -151,7 +154,7 @@ function handleLogin() {
url += '&redirect_uri=' + encodeURIComponent(redirectUrl);
url += '&realm=' + encodeURIComponent(realm);
url += '&client_id=' + encodeURIComponent(clientId);
url += '&scope=' + encodeURIComponent(scopes.join(' '));
url += '&scope=' + encodeURIComponent(scopes.join(scopeSeparator));
url += '&state=' + encodeURIComponent(state);
window.open(url);
@@ -164,8 +167,8 @@ function handleLogin() {
function handleLogout() {
for(key in window.authorizations.authz){
window.authorizations.remove(key)
for(key in window.swaggerUi.api.clientAuthorizations.authz){
window.swaggerUi.api.clientAuthorizations.remove(key)
}
window.enabledScopes = null;
$('.api-ic.ic-on').addClass('ic-off');
@@ -184,7 +187,9 @@ function initOAuth(opts) {
popupMask = (o.popupMask||$('#api-common-mask'));
popupDialog = (o.popupDialog||$('.api-popup-dialog'));
clientId = (o.clientId||errors.push('missing client id'));
clientSecret = (o.clientSecret||errors.push('missing client secret'));
realm = (o.realm||errors.push('missing realm'));
scopeSeparator = (o.scopeSeparator||' ');
if(errors.length > 0){
log('auth unable initialize oauth: ' + errors);
@@ -206,6 +211,7 @@ function initOAuth(opts) {
window.processOAuthCode = function processOAuthCode(data) {
var params = {
'client_id': clientId,
'client_secret': clientSecret,
'code': data.code,
'grant_type': 'authorization_code',
'redirect_uri': redirect_uri
@@ -240,7 +246,7 @@ window.onOAuthComplete = function onOAuthComplete(token) {
if(b){
// if all roles are satisfied
var o = null;
$.each($('.auth #api_information_panel'), function(k, v) {
$.each($('.auth .api-ic .api_information_panel'), function(k, v) {
var children = v;
if(children && children.childNodes) {
var requiredScopes = [];
@@ -257,7 +263,7 @@ window.onOAuthComplete = function onOAuthComplete(token) {
}
}
if(diff.length > 0){
o = v.parentNode;
o = v.parentNode.parentNode;
$(o.parentNode).find('.api-ic.ic-on').addClass('ic-off');
$(o.parentNode).find('.api-ic.ic-on').removeClass('ic-on');
@@ -266,7 +272,7 @@ window.onOAuthComplete = function onOAuthComplete(token) {
$(o).find('.api-ic').removeClass('ic-error');
}
else {
o = v.parentNode;
o = v.parentNode.parentNode;
$(o.parentNode).find('.api-ic.ic-off').addClass('ic-on');
$(o.parentNode).find('.api-ic.ic-off').removeClass('ic-off');
+1486 -1357
View File
File diff suppressed because one or more lines are too long
+12 -16
View File
File diff suppressed because one or more lines are too long
+6
View File
@@ -113,6 +113,12 @@ gulp.task('copy', ['less'], function() {
.pipe(gulp.dest('./dist/lib'))
.on('error', log);
// copy `lang` for translations
gulp
.src(['./lang/**/*.js'])
.pipe(gulp.dest('./dist/lang'))
.on('error', log);
// copy all files inside html folder
gulp
.src(['./src/main/html/**/*'])
+1
View File
@@ -21,6 +21,7 @@ window.SwaggerTranslator.learn({
"Response Code":"Response Code",
"Response Headers":"Response Headers",
"Hide Response":"Hide Response",
"Headers":"Headers",
"Try it out!":"Try it out!",
"Show/Hide":"Show/Hide",
"List Operations":"List Operations",
+52
View File
@@ -0,0 +1,52 @@
'use strict';
/* jshint quotmark: double */
window.SwaggerTranslator.learn({
"Warning: Deprecated":"Advertencia: Obsoleto",
"Implementation Notes":"Notas de implementación",
"Response Class":"Clase de la Respuesta",
"Status":"Status",
"Parameters":"Parámetros",
"Parameter":"Parámetro",
"Value":"Valor",
"Description":"Descripción",
"Parameter Type":"Tipo del Parámetro",
"Data Type":"Tipo del Dato",
"Response Messages":"Mensajes de la Respuesta",
"HTTP Status Code":"Código de Status HTTP",
"Reason":"Razón",
"Response Model":"Modelo de la Respuesta",
"Request URL":"URL de la Solicitud",
"Response Body":"Cuerpo de la Respuesta",
"Response Code":"Código de la Respuesta",
"Response Headers":"Encabezados de la Respuesta",
"Hide Response":"Ocultar Respuesta",
"Try it out!":"Pruébalo!",
"Show/Hide":"Mostrar/Ocultar",
"List Operations":"Listar Operaciones",
"Expand Operations":"Expandir Operaciones",
"Raw":"Crudo",
"can't parse JSON. Raw result":"no puede parsear el JSON. Resultado crudo",
"Model Schema":"Esquema del Modelo",
"Model":"Modelo",
"apply":"aplicar",
"Username":"Nombre de usuario",
"Password":"Contraseña",
"Terms of service":"Términos de Servicio",
"Created by":"Creado por",
"See more at":"Ver más en",
"Contact the developer":"Contactar al desarrollador",
"api version":"versión de la api",
"Response Content Type":"Tipo de Contenido (Content Type) de la Respuesta",
"fetching resource":"buscando recurso",
"fetching resource list":"buscando lista del recurso",
"Explore":"Explorar",
"Show Swagger Petstore Example Apis":"Mostrar Api Ejemplo de Swagger Petstore",
"Can't read from server. It may not have the appropriate access-control-origin settings.":"No se puede leer del servidor. Tal vez no tiene la configuración de control de acceso de origen (access-control-origin) apropiado.",
"Please specify the protocol for":"Por favor, especificar el protocola para",
"Can't read swagger JSON from":"No se puede leer el JSON de swagger desde",
"Finished Loading Resource Information. Rendering Swagger UI":"Finalizada la carga del recurso de Información. Mostrando Swagger UI",
"Unable to read api":"No se puede leer la api",
"from path":"desde ruta",
"server returned":"el servidor retornó"
});
+53
View File
@@ -0,0 +1,53 @@
'use strict';
/* jshint quotmark: double */
window.SwaggerTranslator.learn({
"Warning: Deprecated":"Aviso: Depreciado",
"Implementation Notes":"Notas de Implementação",
"Response Class":"Classe de resposta",
"Status":"Status",
"Parameters":"Parâmetros",
"Parameter":"Parâmetro",
"Value":"Valor",
"Description":"Descrição",
"Parameter Type":"Tipo de parâmetro",
"Data Type":"Tipo de dados",
"Response Messages":"Mensagens de resposta",
"HTTP Status Code":"Código de status HTTP",
"Reason":"Razão",
"Response Model":"Modelo resposta",
"Request URL":"URL requisição",
"Response Body":"Corpo da resposta",
"Response Code":"Código da resposta",
"Response Headers":"Cabeçalho da resposta",
"Headers":"Cabeçalhos",
"Hide Response":"Esconder resposta",
"Try it out!":"Tente agora!",
"Show/Hide":"Mostrar/Esconder",
"List Operations":"Listar operações",
"Expand Operations":"Expandir operações",
"Raw":"Cru",
"can't parse JSON. Raw result":"Falha ao analisar JSON. Resulto cru",
"Model Schema":"Modelo esquema",
"Model":"Modelo",
"apply":"Aplicar",
"Username":"Usuário",
"Password":"Senha",
"Terms of service":"Termos do serviço",
"Created by":"Criado por",
"See more at":"Veja mais em",
"Contact the developer":"Contate o desenvolvedor",
"api version":"Versão api",
"Response Content Type":"Tipo de conteúdo da resposta",
"fetching resource":"busca recurso",
"fetching resource list":"buscando lista de recursos",
"Explore":"Explorar",
"Show Swagger Petstore Example Apis":"Show Swagger Petstore Example Apis",
"Can't read from server. It may not have the appropriate access-control-origin settings.":"Não é possível ler do servidor. Pode não ter as apropriadas configurações access-control-origin",
"Please specify the protocol for":"Por favor especifique o protocolo",
"Can't read swagger JSON from":"Não é possível ler o JSON Swagger de",
"Finished Loading Resource Information. Rendering Swagger UI":"Carregar informação de recurso finalizada. Renderizando Swagger UI",
"Unable to read api":"Não foi possível ler api",
"from path":"do caminho",
"server returned":"servidor retornou"
});
+53
View File
@@ -0,0 +1,53 @@
'use strict';
/* jshint quotmark: double */
window.SwaggerTranslator.learn({
"Warning: Deprecated":"Uyarı: Deprecated",
"Implementation Notes":"Gerçekleştirim Notları",
"Response Class":"Dönen Sınıf",
"Status":"Statü",
"Parameters":"Parametreler",
"Parameter":"Parametre",
"Value":"Değer",
"Description":"Açıklama",
"Parameter Type":"Parametre Tipi",
"Data Type":"Veri Tipi",
"Response Messages":"Dönüş Mesajı",
"HTTP Status Code":"HTTP Statü Kodu",
"Reason":"Gerekçe",
"Response Model":"Dönüş Modeli",
"Request URL":"İstek URL",
"Response Body":"Dönüş İçeriği",
"Response Code":"Dönüş Kodu",
"Response Headers":"Dönüş Üst Bilgileri",
"Hide Response":"Dönüşü Gizle",
"Headers":"Üst Bilgiler",
"Try it out!":"Dene!",
"Show/Hide":"Göster/Gizle",
"List Operations":"Operasyonları Listele",
"Expand Operations":"Operasyonları Aç",
"Raw":"Ham",
"can't parse JSON. Raw result":"JSON çözümlenemiyor. Ham sonuç",
"Model Schema":"Model Şema",
"Model":"Model",
"apply":"uygula",
"Username":"Kullanıcı Adı",
"Password":"Parola",
"Terms of service":"Servis şartları",
"Created by":"Oluşturan",
"See more at":"Daha fazlası için",
"Contact the developer":"Geliştirici ile İletişime Geçin",
"api version":"api versiyon",
"Response Content Type":"Dönüş İçerik Tipi",
"fetching resource":"kaynak getiriliyor",
"fetching resource list":"kaynak listesi getiriliyor",
"Explore":"Keşfet",
"Show Swagger Petstore Example Apis":"Swagger Petstore Örnek Api'yi Gör",
"Can't read from server. It may not have the appropriate access-control-origin settings.":"Sunucudan okuma yapılamıyor. Sunucu access-control-origin ayarlarınızı kontrol edin.",
"Please specify the protocol for":"Lütfen istenen adres için protokol belirtiniz",
"Can't read swagger JSON from":"Swagger JSON bu kaynaktan okunamıyor",
"Finished Loading Resource Information. Rendering Swagger UI":"Kaynak baglantısı tamamlandı. Swagger UI gösterime hazırlanıyor",
"Unable to read api":"api okunamadı",
"from path":"yoldan",
"server returned":"sunucuya dönüldü"
});
+3 -2
View File
@@ -17,10 +17,11 @@ window.SwaggerTranslator = {
_words:[],
translate: function() {
translate: function(sel) {
var $this = this;
sel = sel || '[data-sw-translate]';
$('[data-sw-translate]').each(function() {
$(sel).each(function() {
$(this).html($this._tryTranslate($(this).html()));
$(this).val($this._tryTranslate($(this).val()));
+53
View File
@@ -0,0 +1,53 @@
'use strict';
/* jshint quotmark: double */
window.SwaggerTranslator.learn({
"Warning: Deprecated":"警告:已过时",
"Implementation Notes":"实现备注",
"Response Class":"响应类",
"Status":"状态",
"Parameters":"参数",
"Parameter":"参数",
"Value":"值",
"Description":"描述",
"Parameter Type":"参数类型",
"Data Type":"数据类型",
"Response Messages":"响应消息",
"HTTP Status Code":"HTTP状态码",
"Reason":"原因",
"Response Model":"响应模型",
"Request URL":"请求URL",
"Response Body":"响应体",
"Response Code":"响应码",
"Response Headers":"响应头",
"Hide Response":"隐藏响应",
"Headers":"头",
"Try it out!":"试一下!",
"Show/Hide":"显示/隐藏",
"List Operations":"显示操作",
"Expand Operations":"展开操作",
"Raw":"原始",
"can't parse JSON. Raw result":"无法解析JSON. 原始结果",
"Model Schema":"模型架构",
"Model":"模型",
"apply":"应用",
"Username":"用户名",
"Password":"密码",
"Terms of service":"服务条款",
"Created by":"创建者",
"See more at":"查看更多:",
"Contact the developer":"联系开发者",
"api version":"api版本",
"Response Content Type":"响应Content Type",
"fetching resource":"正在获取资源",
"fetching resource list":"正在获取资源列表",
"Explore":"浏览",
"Show Swagger Petstore Example Apis":"显示 Swagger Petstore 示例 Apis",
"Can't read from server. It may not have the appropriate access-control-origin settings.":"无法从服务器读取。可能没有正确设置access-control-origin。",
"Please specify the protocol for":"请指定协议:",
"Can't read swagger JSON from":"无法读取swagger JSON于",
"Finished Loading Resource Information. Rendering Swagger UI":"已加载资源信息。正在渲染Swagger UI",
"Unable to read api":"无法读取api",
"from path":"从路径",
"server returned":"服务器返回"
});
+12 -6
View File
@@ -5,6 +5,8 @@ var clientId;
var realm;
var oauth2KeyName;
var redirect_uri;
var clientSecret;
var scopeSeparator;
function handleLogin() {
var scopes = [];
@@ -40,6 +42,7 @@ function handleLogin() {
appName = window.swaggerUi.api.info.title;
}
$('.api-popup-dialog').remove();
popupDialog = $(
[
'<div class="api-popup-dialog">',
@@ -151,7 +154,7 @@ function handleLogin() {
url += '&redirect_uri=' + encodeURIComponent(redirectUrl);
url += '&realm=' + encodeURIComponent(realm);
url += '&client_id=' + encodeURIComponent(clientId);
url += '&scope=' + encodeURIComponent(scopes.join(' '));
url += '&scope=' + encodeURIComponent(scopes.join(scopeSeparator));
url += '&state=' + encodeURIComponent(state);
window.open(url);
@@ -164,8 +167,8 @@ function handleLogin() {
function handleLogout() {
for(key in window.authorizations.authz){
window.authorizations.remove(key)
for(key in window.swaggerUi.api.clientAuthorizations.authz){
window.swaggerUi.api.clientAuthorizations.remove(key)
}
window.enabledScopes = null;
$('.api-ic.ic-on').addClass('ic-off');
@@ -184,7 +187,9 @@ function initOAuth(opts) {
popupMask = (o.popupMask||$('#api-common-mask'));
popupDialog = (o.popupDialog||$('.api-popup-dialog'));
clientId = (o.clientId||errors.push('missing client id'));
clientSecret = (o.clientSecret||errors.push('missing client secret'));
realm = (o.realm||errors.push('missing realm'));
scopeSeparator = (o.scopeSeparator||' ');
if(errors.length > 0){
log('auth unable initialize oauth: ' + errors);
@@ -206,6 +211,7 @@ function initOAuth(opts) {
window.processOAuthCode = function processOAuthCode(data) {
var params = {
'client_id': clientId,
'client_secret': clientSecret,
'code': data.code,
'grant_type': 'authorization_code',
'redirect_uri': redirect_uri
@@ -240,7 +246,7 @@ window.onOAuthComplete = function onOAuthComplete(token) {
if(b){
// if all roles are satisfied
var o = null;
$.each($('.auth #api_information_panel'), function(k, v) {
$.each($('.auth .api-ic .api_information_panel'), function(k, v) {
var children = v;
if(children && children.childNodes) {
var requiredScopes = [];
@@ -257,7 +263,7 @@ window.onOAuthComplete = function onOAuthComplete(token) {
}
}
if(diff.length > 0){
o = v.parentNode;
o = v.parentNode.parentNode;
$(o.parentNode).find('.api-ic.ic-on').addClass('ic-off');
$(o.parentNode).find('.api-ic.ic-on').removeClass('ic-on');
@@ -266,7 +272,7 @@ window.onOAuthComplete = function onOAuthComplete(token) {
$(o).find('.api-ic').removeClass('ic-error');
}
else {
o = v.parentNode;
o = v.parentNode.parentNode;
$(o.parentNode).find('.api-ic.ic-off').addClass('ic-on');
$(o.parentNode).find('.api-ic.ic-off').removeClass('ic-off');
+3 -3
View File
@@ -8,9 +8,9 @@
}
],
"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.1.0",
"version": "2.1.3",
"homepage": "http://swagger.io",
"license": "Apache 2.0",
"license": "Apache-2.0",
"main": "dist/swagger-ui.js",
"scripts": {
"build": "gulp",
@@ -50,6 +50,6 @@
"less": "^2.4.0",
"mocha": "^2.1.0",
"selenium-webdriver": "^2.45.0",
"swagger-client": "2.1.1"
"swagger-client": "2.1.5"
}
}
+3
View File
@@ -807,6 +807,9 @@
outline: 2px solid black;
outline-color: #cc0000;
}
.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content form select[name='parameterContentType'] {
max-width: 300px;
}
.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content div.response div.block pre {
font-family: "Anonymous Pro", "Menlo", "Consolas", "Bitstream Vera Sans Mono", "Courier New", monospace;
padding: 10px;
+21 -12
View File
@@ -807,6 +807,9 @@
outline: 2px solid black;
outline-color: #cc0000;
}
.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content form select[name='parameterContentType'] {
max-width: 300px;
}
.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content div.response div.block pre {
font-family: "Anonymous Pro", "Menlo", "Consolas", "Bitstream Vera Sans Mono", "Courier New", monospace;
padding: 10px;
@@ -1155,8 +1158,16 @@
.swagger-section .auth {
float: right;
}
.swagger-section #api_information_panel {
position: absolute;
.swagger-section .api-ic {
height: 18px;
vertical-align: middle;
display: inline-block;
background: url(../images/explorer_icons.png) no-repeat;
}
.swagger-section .api-ic .api_information_panel {
position: relative;
margin-top: 20px;
margin-left: -5px;
background: #FFF;
border: 1px solid #ccc;
border-radius: 5px;
@@ -1167,34 +1178,32 @@
color: black;
padding: 5px;
}
.swagger-section #api_information_panel p .api-msg-enabled {
.swagger-section .api-ic .api_information_panel p .api-msg-enabled {
color: green;
}
.swagger-section #api_information_panel p .api-msg-disabled {
.swagger-section .api-ic .api_information_panel p .api-msg-disabled {
color: red;
}
.swagger-section .api-ic {
height: 18px;
vertical-align: middle;
display: inline-block;
background: url(../images/explorer_icons.png) no-repeat;
.swagger-section .api-ic:hover .api_information_panel {
position: absolute;
display: block;
}
.swagger-section .ic-info {
background-position: 0 0;
width: 18px;
margin-top: -7px;
margin-top: -6px;
margin-left: 4px;
}
.swagger-section .ic-warning {
background-position: -60px 0;
width: 18px;
margin-top: -7px;
margin-top: -6px;
margin-left: 4px;
}
.swagger-section .ic-error {
background-position: -30px 0;
width: 18px;
margin-top: -7px;
margin-top: -6px;
margin-left: 4px;
}
.swagger-section .ic-off {
+20 -3
View File
@@ -1,6 +1,7 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<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" />
@@ -21,6 +22,11 @@
<script src='lib/marked.js' type='text/javascript'></script>
<script src='lib/swagger-oauth.js' type='text/javascript'></script>
<!-- Some basic translations -->
<!-- <script src='lang/translator.js' type='text/javascript'></script> -->
<!-- <script src='lang/ru.js' type='text/javascript'></script> -->
<!-- <script src='lang/en.js' type='text/javascript'></script> -->
<script type="text/javascript">
$(function () {
var url = window.location.search.match(/url=([^&]+)/);
@@ -29,6 +35,11 @@
} else {
url = "http://petstore.swagger.io/v2/swagger.json";
}
// Pre load translate...
if(window.SwaggerTranslator) {
window.SwaggerTranslator.translate();
}
window.swaggerUi = new SwaggerUi({
url: url,
dom_id: "swagger-ui-container",
@@ -37,11 +48,17 @@
if(typeof initOAuth == "function") {
initOAuth({
clientId: "your-client-id",
clientSecret: "your-client-secret",
realm: "your-realms",
appName: "your-app-name"
appName: "your-app-name",
scopeSeparator: ","
});
}
if(window.SwaggerTranslator) {
window.SwaggerTranslator.translate();
}
$('pre code').each(function(i, e) {
hljs.highlightBlock(e)
});
@@ -91,12 +108,12 @@
<form id='api_selector'>
<div class='input'><input placeholder="http://example.com/api" id="input_baseUrl" name="baseUrl" type="text"/></div>
<div class='input'><input placeholder="api_key" id="input_apiKey" name="apiKey" type="text"/></div>
<div class='input'><a id="explore" href="#">Explore</a></div>
<div class='input'><a id="explore" href="#" data-sw-translate>Explore</a></div>
</form>
</div>
</div>
<div id="message-bar" class="swagger-ui-wrap">&nbsp;</div>
<div id="message-bar" class="swagger-ui-wrap" data-sw-translate>&nbsp;</div>
<div id="swagger-ui-container" class="swagger-ui-wrap"></div>
</body>
</html>
+8 -4
View File
@@ -173,9 +173,13 @@ window.SwaggerUi = Backbone.Router.extend({
if (data === undefined) {
data = '';
}
$('#message-bar').removeClass('message-fail');
$('#message-bar').addClass('message-success');
$('#message-bar').text(data);
var $msgbar = $('#message-bar');
$msgbar.removeClass('message-fail');
$msgbar.addClass('message-success');
$msgbar.html(data);
if(window.SwaggerTranslator) {
window.SwaggerTranslator.translate($msgbar);
}
},
// shows message in red
@@ -253,7 +257,7 @@ window.SwaggerUi.Views = {};
});
} else if (typeof exports === 'object') {
// Node. Does not work with strict CommonJS, but
// only CommonJS-like enviroments that support module.exports,
// only CommonJS-like environments that support module.exports,
// like Node.
module.exports = factory(require('b'));
} else {
+10 -2
View File
@@ -11,6 +11,14 @@ Handlebars.registerHelper('renderTextParam', function(param) {
var isArray = param.type.toLowerCase() === 'array' || param.allowMultiple;
var defaultValue = isArray && Array.isArray(param.default) ? param.default.join('\n') : param.default;
var dataVendorExtensions = Object.keys(param).filter(function(property) {
// filter X-data- properties
return property.match(/^X-data-/i) !== null;
}).reduce(function(result, property) {
// remove X- from property name, so it results in html attributes like data-foo='bar'
return result += ' ' + property.substring(2, property.length) + '=\'' + param[property] + '\'';
}, '');
if (typeof defaultValue === 'undefined') {
defaultValue = '';
}
@@ -24,7 +32,7 @@ Handlebars.registerHelper('renderTextParam', function(param) {
}
if(isArray) {
result = '<textarea class=\'body-textarea' + (param.required ? ' required' : '') + '\' name=\'' + param.name + '\'' + idAtt;
result = '<textarea class=\'body-textarea' + (param.required ? ' required' : '') + '\' name=\'' + param.name + '\'' + idAtt + dataVendorExtensions;
result += ' placeholder=\'Provide multiple values in new lines' + (param.required ? ' (at least one required).' : '.') + '\'>';
result += defaultValue + '</textarea>';
} else {
@@ -33,7 +41,7 @@ Handlebars.registerHelper('renderTextParam', function(param) {
parameterClass += ' required';
}
result = '<input class=\'' + parameterClass + '\' minlength=\'' + (param.required ? 1 : 0) + '\'';
result += ' name=\'' + param.name +'\' placeholder=\'' + (param.required ? '(required)' : '') + '\'' + idAtt;
result += ' name=\'' + param.name +'\' placeholder=\'' + (param.required ? '(required)' : '') + '\'' + idAtt + dataVendorExtensions;
result += ' type=\'' + type + '\' value=\'' + defaultValue + '\'/>';
}
return new Handlebars.SafeString(result);
+1 -1
View File
@@ -62,7 +62,7 @@ SwaggerUi.Views.MainView = Backbone.View.extend({
this.model.validatorUrl = null;
} else {
// Default validator
if(window.location.protocol === 'https') {
if(window.location.protocol === 'https:') {
this.model.validatorUrl = 'https://online.swagger.io/validator';
}
else {
+19 -23
View File
@@ -9,7 +9,6 @@ SwaggerUi.Views.OperationView = Backbone.View.extend({
'click .response_hider' : 'hideResponse',
'click .toggleOperation' : 'toggleOperationContent',
'mouseenter .api-ic' : 'mouseEnter',
'mouseout .api-ic' : 'mouseExit',
'dblclick .curl' : 'selectText',
},
@@ -33,7 +32,7 @@ SwaggerUi.Views.OperationView = Backbone.View.extend({
range.moveToElementText(text);
range.select();
} else if (window.getSelection) {
selection = window.getSelection();
selection = window.getSelection();
range = document.createRange();
range.selectNodeContents(text);
selection.removeAllRanges();
@@ -72,11 +71,6 @@ SwaggerUi.Views.OperationView = Backbone.View.extend({
pos.top = y;
pos.left = x;
elem.css(pos);
$(e.currentTarget.parentNode).find('#api_information_panel').show();
},
mouseExit: function(e) {
$(e.currentTarget.parentNode).find('#api_information_panel').hide();
},
// Note: copied from CoffeeScript compiled file
@@ -95,22 +89,23 @@ SwaggerUi.Views.OperationView = Backbone.View.extend({
for (l = 0, len = modelAuths.length; l < len; l++) {
auths = modelAuths[l];
for (key in auths) {
auth = auths[key];
for (a in this.auths) {
auth = this.auths[a];
if (auth.type === 'oauth2') {
this.model.oauth = {};
this.model.oauth.scopes = [];
ref1 = auth.value.scopes;
for (k in ref1) {
v = ref1[k];
scopeIndex = auths[key].indexOf(k);
if (scopeIndex >= 0) {
o = {
scope: k,
description: v
};
this.model.oauth.scopes.push(o);
if (key === auth.name) {
if (auth.type === 'oauth2') {
this.model.oauth = {};
this.model.oauth.scopes = [];
ref1 = auth.value.scopes;
for (k in ref1) {
v = ref1[k];
scopeIndex = auths[key].indexOf(k);
if (scopeIndex >= 0) {
o = {
scope: k,
description: v
};
this.model.oauth.scopes.push(o);
}
}
}
}
@@ -144,8 +139,8 @@ SwaggerUi.Views.OperationView = Backbone.View.extend({
schemaObj = this.model.responses[code].schema;
if (schemaObj && schemaObj.$ref) {
schema = schemaObj.$ref;
if (schema.indexOf('#/definitions/') === 0) {
schema = schema.substring('#/definitions/'.length);
if (schema.indexOf('#/definitions/') !== -1) {
schema = schema.replace(/^.*#\/definitions\//, '');
}
}
this.model.responseMessages.push({
@@ -679,6 +674,7 @@ SwaggerUi.Views.OperationView = Backbone.View.extend({
$.bbq.pushState('#/', 2);
Docs.collapseOperation(elem);
} else {
event.preventDefault();
Docs.expandOperation(elem);
}
},
+3 -1
View File
@@ -52,7 +52,9 @@ SwaggerUi.Views.SignatureView = Backbone.View.extend({
if (e) { e.preventDefault(); }
var textArea = $('textarea', $(this.el.parentNode.parentNode.parentNode));
if ($.trim(textArea.val()) === '') {
// Fix for bug in IE 10/11 which causes placeholder text to be copied to "value"
if ($.trim(textArea.val()) === '' || textArea.prop('placeholder') === textArea.val()) {
textArea.val(this.model.sampleJSON);
}
}
+33 -25
View File
@@ -12,50 +12,58 @@
float: right;
}
#api_information_panel {
position: absolute;
background: #FFF;
border: 1px solid #ccc;
border-radius: 5px;
display: none;
font-size: 13px;
max-width: 300px;
line-height: 30px;
color: black;
padding: 5px;
p {
.api-msg-enabled {
color: green;
}
.api-msg-disabled {
color: red;
}
}
}
.api-ic {
height: 18px;
vertical-align: middle;
display: inline-block;
background: url(../images/explorer_icons.png) no-repeat;
.api_information_panel {
position: relative;
margin-top: 20px;
margin-left: -5px;
background: #FFF;
border: 1px solid #ccc;
border-radius: 5px;
display: none;
font-size: 13px;
max-width: 300px;
line-height: 30px;
color: black;
padding: 5px;
p {
.api-msg-enabled {
color: green;
}
.api-msg-disabled {
color: red;
}
}
}
}
.api-ic:hover {
.api_information_panel {
position: absolute;
display: block;
}
}
.ic-info {
background-position: 0 0;
width: 18px;
margin-top: -7px;
margin-top: -6px;
margin-left: 4px;
}
.ic-warning {
background-position: -60px 0;
width: 18px;
margin-top: -7px;
margin-top: -6px;
margin-left: 4px;
}
.ic-error {
background-position: -30px 0;
width: 18px;
margin-top: -7px;
margin-top: -6px;
margin-left: 4px;
}
.ic-off {
@@ -136,4 +144,4 @@
padding-top: 10px;
}
}
}
+4 -1
View File
@@ -744,6 +744,9 @@
outline: 2px solid black;
outline-color: #cc0000;
}
select[name='parameterContentType'] {
max-width:300px;
}
}
div.response {
div.block {
@@ -1104,4 +1107,4 @@
}
}
}
}
@@ -3,7 +3,6 @@
<div class='key_input_container'>
<div class='auth_label'><label for='input_apiKey_entry'>{{keyName}}</label></div>
<input placeholder='api_key' class='auth_input' id='input_apiKey_entry' name='apiKey' type='text'/>
<div class='auth_submit'><a class='auth_submit_button' id='apply_api_key' href='#''>apply</a></div>
<div class='auth_submit'><a class='auth_submit_button' id='apply_api_key' href='#' data-sw-translate>apply</a></div>
</div>
</div>
@@ -1,9 +1,9 @@
<div class='auth_button' id='basic_auth_button'><img class='auth_icon' src='images/password.jpeg'></div>
<div class='auth_container' id='basic_auth_container'>
<div class='key_input_container'>
<div class="auth_label"><label for="input_username">Username</label></div>
<div class="auth_label"><label for="input_username" data-sw-translate>Username</label></div>
<input placeholder="username" class="auth_input" id="input_username" name="username" type="text"/>
<div class="auth_label"><label for="password">Password</label></div>
<div class="auth_label"><label for="password" data-sw-translate>Password</label></div>
<input placeholder="password" class="auth_input" id="input_password" name="password" type="password"/>
<div class='auth_submit'><a class='auth_submit_button' id="apply_basic_auth" href="#">apply</a></div>
</div>
+1 -1
View File
@@ -1,4 +1,4 @@
<label for="{{contentTypeId}}">Response Content Type</label>
<label data-sw-translate for="{{contentTypeId}}">Response Content Type</label>
<select name="contentType" id="{{contentTypeId}}">
{{#if produces}}
{{#each produces}}
+5 -5
View File
@@ -6,10 +6,10 @@
<p>{{externalDocs.description}}</p>
<a href="{{externalDocs.url}}" target="_blank">{{externalDocs.url}}</a>
{{/if}}
{{#if info.termsOfServiceUrl}}<div class="info_tos"><a href="{{info.termsOfServiceUrl}}">Terms of service</a></div>{{/if}}
{{#if info.contact.name}}<div class='info_name'>Created by {{info.contact.name}}</div>{{/if}}
{{#if info.contact.url}}<div class='info_url'>See more at <a href="{{info.contact.url}}">{{info.contact.url}}</a></div>{{/if}}
{{#if info.contact.email}}<div class='info_email'><a href="mailto:{{info.contact.email}}?subject={{info.title}}">Contact the developer</a></div>{{/if}}
{{#if info.termsOfServiceUrl}}<div class="info_tos"><a href="{{info.termsOfServiceUrl}}" data-sw-translate>Terms of service</a></div>{{/if}}
{{#if info.contact.name}}<div class='info_name' data-sw-translate>Created by {{info.contact.name}}</div>{{/if}}
{{#if info.contact.url}}<div class='info_url' data-sw-translate>See more at <a href="{{info.contact.url}}">{{info.contact.url}}</a></div>{{/if}}
{{#if info.contact.email}}<div class='info_email'><a href="mailto:{{info.contact.email}}?subject={{info.title}}" data-sw-translate>Contact the developer</a></div>{{/if}}
{{#if info.license}}<div class='info_license'><a href='{{info.license.url}}'>{{info.license.name}}</a></div>{{/if}}
{{/if}}
</div>
@@ -19,7 +19,7 @@
<div class="footer">
<h4 style="color: #999">[ <span style="font-variant: small-caps">base url</span>: {{basePath}}
{{#if info.version}}
, <span style="font-variant: small-caps">api version</span>: {{info.version}}
, <span style="font-variant: small-caps" data-sw-translate>api version</span>: {{info.version}}
{{/if}}]
{{#if validatorUrl}}
<span style="float:right"><a href="{{validatorUrl}}/debug?url={{url}}"><img id="validator" src="{{validatorUrl}}?url={{url}}"></a>
+22 -22
View File
@@ -26,22 +26,22 @@
{{/if}}
{{#oauth}}
<div class="auth">
<span class="api-ic ic-error"></span>{{/oauth}}
<span class="api-ic ic-error">{{/oauth}}
{{#each oauth}}
<div id="api_information_panel" style="top: 526px; left: 776px; display: none;">
<div class="api_information_panel">
{{#each this}}
<div title='{{{this.description}}}'>{{this.scope}}</div>
{{/each}}
</div>
{{/each}}
{{#oauth}}</div>{{/oauth}}
{{#oauth}}</span></div>{{/oauth}}
{{#oauth}}
<div class='access'>
<span class="api-ic ic-off" title="click to authenticate"></span>
</div>
{{/oauth}}
{{#if type}}
<h4>Response Class (Status {{successCode}})</h4>
<h4><span data-sw-translate>Response Class</span> (<span data-sw-translate>Status</span> {{successCode}})</h4>
<p><span class="model-signature" /></p>
<br/>
<div class="response-content-type" />
@@ -49,15 +49,15 @@
<form accept-charset='UTF-8' class='sandbox'>
<div style='margin:0;padding:0;display:inline'></div>
{{#if parameters}}
<h4>Parameters</h4>
<h4 data-sw-translate>Parameters</h4>
<table class='fullwidth'>
<thead>
<tr>
<th style="width: 100px; max-width: 100px">Parameter</th>
<th style="width: 310px; max-width: 310px">Value</th>
<th style="width: 200px; max-width: 200px">Description</th>
<th style="width: 100px; max-width: 100px">Parameter Type</th>
<th style="width: 220px; max-width: 230px">Data Type</th>
<th style="width: 100px; max-width: 100px" data-sw-translate>Parameter</th>
<th style="width: 310px; max-width: 310px" data-sw-translate>Value</th>
<th style="width: 200px; max-width: 200px" data-sw-translate>Description</th>
<th style="width: 100px; max-width: 100px" data-sw-translate>Parameter Type</th>
<th style="width: 220px; max-width: 230px" data-sw-translate>Data Type</th>
</tr>
</thead>
<tbody class="operation-params">
@@ -67,14 +67,14 @@
{{/if}}
{{#if responseMessages}}
<div style='margin:0;padding:0;display:inline'></div>
<h4>Response Messages</h4>
<h4 data-sw-translate>Response Messages</h4>
<table class='fullwidth'>
<thead>
<tr>
<th>HTTP Status Code</th>
<th>Reason</th>
<th>Response Model</th>
<th>Headers</th>
<th data-sw-translate>HTTP Status Code</th>
<th data-sw-translate>Reason</th>
<th data-sw-translate>Response Model</th>
<th data-sw-translate>Headers</th>
</tr>
</thead>
<tbody class="operation-status">
@@ -85,8 +85,8 @@
{{#if isReadOnly}}
{{else}}
<div class='sandbox_header'>
<input class='submit' type='button' value='Try it out!' />
<a href='#' class='response_hider' style='display:none'>Hide Response</a>
<input class='submit' type='button' value='Try it out!' data-sw-translate/>
<a href='#' class='response_hider' style='display:none' data-sw-translate>Hide Response</a>
<span class='response_throbber' style='display:none'></span>
</div>
{{/if}}
@@ -94,17 +94,17 @@
<div class='response' style='display:none'>
<h4>Curl</h4>
<div class='block curl'></div>
<h4>Request URL</h4>
<h4 data-sw-translate>Request URL</h4>
<div class='block request_url'></div>
{{#if showRequestHeaders}}
<h4>Request Headers</h4>
<h4 data-sw-translate>Request Headers</h4>
<div class='block request_headers'></div>
{{/if}}
<h4>Response Body</h4>
<h4 data-sw-translate>Response Body</h4>
<div class='block response_body'></div>
<h4>Response Code</h4>
<h4 data-sw-translate>Response Code</h4>
<div class='block response_code'></div>
<h4>Response Headers</h4>
<h4 data-sw-translate>Response Headers</h4>
<div class='block response_headers'></div>
</div>
</div>
+1 -1
View File
@@ -1,4 +1,4 @@
<td class='code{{#if required}} required{{/if}}'><label for='{{valueId}}'>{{name}}</labe></td>
<td class='code{{#if required}} required{{/if}}'><label for='{{valueId}}'>{{name}}</label></td>
<td>
<select {{#isArray this}} multiple="multiple"{{/isArray}} class="parameter {{#if required}} required {{/if}}" name="{{name}}" id="{{valueId}}">
+4 -4
View File
@@ -4,21 +4,21 @@
</h2>
<ul class='options'>
<li>
<a href='#!/{{id}}' id='endpointListTogger_{{id}}' class="toggleEndpointList" data-id="{{id}}">Show/Hide</a>
<a href='#!/{{id}}' id='endpointListTogger_{{id}}' class="toggleEndpointList" data-id="{{id}}" data-sw-translate>Show/Hide</a>
</li>
<li>
<a href='#' class="collapseResource" data-id="{{id}}">
<a href='#' class="collapseResource" data-id="{{id}}" data-sw-translate>
List Operations
</a>
</li>
<li>
<a href='#' class="expandResource" data-id="{{id}}">
<a href='#' class="expandResource" data-id="{{id}}" data-sw-translate>
Expand Operations
</a>
</li>
{{#if url}}
<li>
<a href='{{url}}'>Raw</a>
<a href='{{url}}' data-sw-translate>Raw</a>
</li>
{{/if}}
</ul>
@@ -1,4 +1,4 @@
<label for="{{responseContentTypeId}}">Response Content Type</label>
<label data-sw-translate for="{{responseContentTypeId}}">Response Content Type</label>
<select name="responseContentType" id="{{responseContentTypeId}}">
{{#if produces}}
{{#each produces}}
+2 -2
View File
@@ -1,7 +1,7 @@
<div>
<ul class="signature-nav">
<li><a class="description-link" href="#">Model</a></li>
<li><a class="snippet-link" href="#">Model Schema</a></li>
<li><a class="description-link" href="#" data-sw-translate>Model</a></li>
<li><a class="snippet-link" href="#" data-sw-translate>Model Schema</a></li>
</ul>
<div>
+6 -2
View File
@@ -28,8 +28,12 @@ module.exports.start = function (specsLocation, done) {
setTimeout(function(){
driver.get(url);
done();
}, process.env.TRAVIS ? 20000 : 3000);
setTimeout(function() {
done();
}, 2000);
console.log('waiting for UI to load');
}, process.env.TRAVIS ? 20000 : 5000);
console.log('waiting for server to start');
};
module.exports.close = function() {
+6 -8
View File
@@ -4,6 +4,7 @@ var expect = require('chai').expect;
var driver = require('./driver');
var servers = require('./servers');
var webdriver = require('selenium-webdriver');
var until = webdriver.until;
var elements = [
'swagger-ui-container',
@@ -39,12 +40,8 @@ describe('swagger 1.x spec tests', function () {
});
});
it('should have "Swagger UI" in title', function (done) {
driver.sleep(200);
driver.getTitle().then(function(title) {
expect(title).to.contain('Swagger UI');
done();
});
it('should have "Swagger UI" in title', function () {
return driver.wait(until.titleIs('Swagger UI'), 1000);
});
elements.forEach(function (id) {
@@ -99,7 +96,8 @@ describe('swagger 1.x spec tests', function () {
});
});
after(function(){
after(function(done){
servers.close();
done();
});
});
});
+8 -11
View File
@@ -4,7 +4,7 @@ var expect = require('chai').expect;
var webdriver = require('selenium-webdriver');
var driver = require('./driver');
var servers = require('./servers');
var until = webdriver.until;
var elements = [
'swagger-ui-container',
@@ -17,10 +17,10 @@ var elements = [
];
describe('swagger 2.0 spec tests', function () {
this.timeout(10 * 1000);
this.timeout(40 * 1000);
before(function (done) {
this.timeout(25 * 1000);
this.timeout(50 * 1000);
servers.start('/v2/petstore.json', done);
});
@@ -40,12 +40,8 @@ describe('swagger 2.0 spec tests', function () {
});
});
it('should have "Swagger UI" in title', function (done) {
driver.sleep(200);
driver.getTitle().then(function(title) {
expect(title).to.contain('Swagger UI');
done();
});
it('should have "Swagger UI" in title', function () {
return driver.wait(until.titleIs('Swagger UI'), 1000);
});
elements.forEach(function (id) {
@@ -114,7 +110,8 @@ describe('swagger 2.0 spec tests', function () {
});
});
after(function() {
after(function(done) {
servers.close();
done();
});
});
});