Compare commits

...
194 Commits
Author SHA1 Message Date
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
Tony Tam 1f73415d08 Merge pull request #1345 from swagger-api/develop_2.0
merge from develop 2.0 for release
2015-06-06 15:35:02 -07:00
Tony Tam 673881007c updated versions, rebuilt 2015-06-06 15:32:28 -07:00
Tony Tam 5ee553ecce removed extra tag 2015-06-06 15:23:42 -07:00
Tony Tam c7e07705f2 removed logging 2015-06-06 08:22:40 -07:00
Tony Tam 7cc1a36d95 updated version 2015-06-05 16:48:06 -07:00
Jeremy Whitlock a4124fba7c Update swagger-ui to reuse client authorizations properly
Fixes #472
2015-06-05 17:45:14 -06:00
Ron 26ac3af551 Merge pull request #1342 from ponelat/fix/remove-dead-code
remove dead code: show-wordnik-dev
2015-06-05 10:06:35 -04:00
Josh Ponelat dfab1df1e9 remove dead code: show-wordnik-dev 2015-06-05 10:56:39 +02:00
Ron f3e7beecf3 Updated project location 2015-06-04 15:36:42 -04:00
Ron 57327f5d1f Updated ToS 2015-06-04 15:15:44 -04:00
Ron 26618ba482 Updated License 2015-06-04 15:15:37 -04:00
Ron 74211117e5 Merge pull request #1341 from ponelat/fix/completely-remove-bootstrap-min
finish removing bootstrap.min entirely
2015-06-04 15:01:35 -04:00
Josh Ponelat 81ff9ee8c8 finish removing bootstrap.min entirely 2015-06-04 20:49:21 +02:00
Ron c29e582b35 Merge pull request #1339 from shawngong/master
removed unused bootstrap.min.js file
2015-06-04 14:41:27 -04:00
Shawn Gong 9b8d663a0a removed unused bootstrap.min.js file 2015-06-04 14:14:48 -04:00
Tony Tam c4919c39db Merge pull request #1227 from ponelat/fix/default-boolean
allow default to be false, tweak "required" in param_list
2015-06-04 07:34:56 -07:00
Josh Ponelat a126c17841 fixed support for default values in param_list 2015-06-04 08:53:12 +02:00
Tony Tam 9ba75c02be fix for lint errors 2015-06-03 23:04:57 -07:00
Tony Tam 1f6d89cda4 Merge branch 'develop_2.0' of github.com:swagger-api/swagger-ui into develop_2.0 2015-06-03 22:48:08 -07:00
Tony Tam 3bd4edd25f Merge branch 'ponelat-fix/xss-index-html' into develop_2.0 2015-06-03 22:47:46 -07:00
Tony Tam 9e9ca13850 merged 2015-06-03 22:47:39 -07:00
Tony Tam e93215178d Merge pull request #1316 from bnupaladin/develop_2.0
Update translator.js
2015-06-03 22:46:16 -07:00
Tony Tam 2e396c1118 Merge branch 'shawngong-master' into develop_2.0 2015-06-03 22:45:42 -07:00
Tony Tam 58dadc64f8 rebuilt 2015-06-03 22:45:26 -07:00
Tony Tam ac787d062c rebuilt 2015-06-03 22:40:58 -07:00
Tony Tam 62afd58210 merged 2015-06-03 22:36:46 -07:00
Tony Tam 0e2102d7c6 Merge branch 'bdkosher-develop_2.0' into develop_2.0 2015-06-03 22:24:24 -07:00
Tony Tam 8ab141aa7f Merge branch 'develop_2.0' of ssh://github.com/bdkosher/swagger-ui into bdkosher-develop_2.0 2015-06-03 22:23:48 -07:00
Tony Tam 5a73c3d5b7 rebuilt 2015-06-03 22:23:13 -07:00
Tony Tam a8e2f27365 Merge branch 'nprdm-feature/request_headers' into develop_2.0 2015-06-03 22:16:52 -07:00
Tony Tam fc6ad9977c merged 2015-06-03 22:16:43 -07:00
Tony Tam 3b58cc8a60 Merge branch 'nprdm-feature/hashchange' into develop_2.0 2015-06-03 22:15:07 -07:00
Tony Tam eae5dd3df9 merged 2015-06-03 22:15:00 -07:00
Tony Tam ab8d1f4947 Merge branch 'nprdm-feature/GFM_descriptions' into develop_2.0 2015-06-03 22:13:05 -07:00
Tony Tam 8c7997a033 merged 2015-06-03 22:12:51 -07:00
Tony Tam f8269da3ab Merge branch 'ponelat-fix/default-boolean' into develop_2.0 2015-06-03 22:06:47 -07:00
Tony Tam 559b17942f rebuilt 2015-06-03 22:06:32 -07:00
Shawn Gong 1ef90c4240 rewrote into source files, generate using gulp 2015-06-02 10:11:00 -04:00
Josh Ponelat 162cd536a1 use $.text instead of $.html for showMessage and onFailure 2015-06-01 13:06:31 +02:00
Shawn Gong d99c6ce828 rewrote using asCurl 2015-05-27 13:29:59 -04:00
bnupaladin c0ea250ddd Update translator.js
when translate word, trim the word first, in case the word doesn't match the key of wordsMap.
2015-05-27 15:38:21 +08:00
Shawn Gong 6cfa818b02 curl hack to showcase curl output in the swagger-ui 2015-05-26 14:39:19 -04:00
Ron 0ad8c74e32 Update README.md 2015-05-26 09:27:34 -04:00
Ron f289076440 Update README.md 2015-05-26 09:27:04 -04:00
Tony Tam bcf52d351b updated validator badge logic per #1299 2015-05-19 11:28:21 -07:00
Vitaliy Kanev 88838213c8 remove fileupload function 2015-05-16 15:47:45 +03:00
Vitaliy Kanev 9688af989e fixed: REFACTOR handleFileUpload 2015-05-16 15:42:50 +03:00
Канев Виталий 2bed4ffdd9 Merge pull request #2 from swagger-api/master
update
2015-05-16 15:40:15 +03:00
Joe Wolf 488611a4ff 508 Fixes
Addresses #1021 mostly by adding label tags, generating unique element
ids as needed.

In the process, moved the label text that gets set in the
___ContentTypeView.js files to the respective handlebar templates; the
text was static as far as I could tell.

There are additional minor 508 improvements that can be made with the
tables (scope tags, header attributes)
2015-05-15 11:16:50 -04:00
Nara Kasbergen 6ce834cfa9 fixes #693 2015-05-14 18:13:31 -04:00
Nara Kasbergen 59f53a96c1 fixes #958 2015-05-14 17:14:03 -04:00
Nara Kasbergen 37d29df074 Add support for GFM syntax in model (schema) descriptions -- relies on one small change to swagger-client 2015-05-14 15:36:23 -04:00
Tony Tam 198dd641b4 Merge pull request #1285 from swagger-api/develop_2.0
Merged from develop_2.0
2015-05-14 09:00:23 -04:00
Tony Tam b5039b28b0 rebuilt 2015-05-14 08:56:49 -04:00
Tony Tam d5c79f84f6 added authorizations 2015-05-14 08:56:42 -04:00
Tony Tam eb70c736df Merge pull request #1282 from nprdm/develop_2.0
Fixes #1233
2015-05-13 17:41:34 -04:00
Nara Kasbergen 831a7ae604 Just realized this adds some extra horizontal padding which may not be desirable, so this fixes that 2015-05-13 17:31:47 -04:00
Nara Kasbergen c2dee786e4 Fixes #1233 2015-05-13 16:39:01 -04:00
Tony Tam 688244f190 Merge pull request #1281 from nprdm/develop_2.0
Fixes #1268
2015-05-13 16:31:24 -04:00
Nara Kasbergen 41eb5237ef Fixes #1268 2015-05-13 16:26:11 -04:00
Tony Tam 693b4d97ed Merge pull request #1280 from nprdm/develop_2.0
Use the correct new sorting parameter name
2015-05-13 14:53:33 -04:00
Nara Kasbergen 9923b3cf8a Use the correct new sorting parameter name 2015-05-13 11:47:25 -04:00
Tony Tam 49754457d8 Merge pull request #1278 from swagger-api/develop_2.0
Merged from develop_2.0
2015-05-13 08:53:39 -04:00
Tony Tam 666246c14c rebuilt 2015-05-13 08:50:40 -04:00
Tony Tam 28c63cc3ab merged 2015-05-13 08:49:50 -04:00
Tony Tam 96e73d07e6 updated versions for patch release 2015-05-13 08:49:06 -04:00
Tony Tam 0aa3ff343e Merge pull request #1277 from bloodyowl/fix.es5
fixed MainView for ES5 browser.
2015-05-13 08:43:52 -04:00
Matthias Le Brun 082dc476e6 fixed MainView for ES5 browser.
calling ES6 String.prototype.startWith doesn't work in all browsers
yet.
2015-05-13 14:41:08 +02:00
Tony Tam d3bc023302 Merge pull request #1275 from swagger-api/develop_2.0
Merged from develop_2.0
2015-05-13 07:31:32 -04:00
Tony Tam bf7164119b updated swagger-js, rebuilt 2015-05-13 07:24:57 -04:00
Tony Tam 95bf95e91f fix for #1257 2015-05-10 17:59:25 -07:00
Tony Tam 9d8ccc40dc Merge pull request #1254 from swagger-api/develop_2.0
Merged from develop_2.0
2015-05-08 15:42:49 -07:00
Tony Tam 5640bf782f updated swagger-client version 2015-05-08 15:30:21 -07:00
Tony Tam 261e1894e0 set highlight threshold per #1184 2015-05-08 14:45:19 -07:00
Tony Tam 9e70c95499 updated per #931 2015-05-08 13:56:20 -07:00
Tony Tam 4365d34ee1 rebuilt 2015-05-08 13:29:47 -07:00
Tony Tam 97ed093e6e Merge pull request #1239 from ponelat/develop_2.0
fixes #1205, remove dead line
2015-05-08 13:29:02 -07:00
Tony Tam a02cea119d merged #1238 2015-05-08 13:28:12 -07:00
Tony Tam 8661a0f2f6 Merge pull request #1225 from ponelat/fix/1194
fix oauth switch
2015-05-08 12:52:05 -07:00
Tony Tam e0d17d0755 Merge pull request #1224 from ponelat/fix/1221
add jshint to gulp..lint and dist
2015-05-08 12:51:27 -07:00
Tony Tam 4f3116930b merged 2015-05-08 12:50:45 -07:00
Tony Tam 5abd2819f9 merged 2015-05-08 12:48:16 -07:00
Tony Tam 99bec82087 Merge branch 'develop_2.0' of github.com:swagger-api/swagger-ui into develop_2.0 2015-05-08 12:45:12 -07:00
Tony Tam b1efe883db merged logic from #1177 2015-05-08 12:45:00 -07:00
Tony Tam 17dca9e256 Merge pull request #1173 from BjRo/handle_whitespace_in_response
Prevent the OperationView to display an error in case the response contains a whitespace only body with content type application/json
2015-05-08 12:30:01 -07:00
Tony Tam cdd80820cf fix for #1253 2015-05-08 12:23:18 -07:00
Tony Tam d7bc0c6cbe Merge branch 'valdemon-multi-value-params' into develop_2.0 2015-05-08 12:21:02 -07:00
Tony Tam 9c58ed7018 Merge branch 'multi-value-params' of ssh://github.com/valdemon/swagger-ui into valdemon-multi-value-params 2015-05-08 12:10:01 -07:00
Tony Tam 1696a1ba34 added fix from outdated PR #1122 2015-05-08 12:06:56 -07:00
Tony Tam ba855e3d04 Merge pull request #1112 from 3scale/op-execute
Pass swagger options to swagger-js Operation#execute method
2015-05-08 12:03:56 -07:00
Tony Tam 6d5f6de537 Fix for #1252, check for http protocol before setting validator url 2015-05-08 12:02:30 -07:00
Tony Tam ccfc4aa4ba manually added #1086, #1089 2015-05-08 12:01:06 -07:00
Tony Tam 9666eaeb96 updated swagger-client version 2015-05-08 06:26:07 -07:00
Josh Ponelat 37f4850ce2 fixes #1205, remove dead line 2015-05-05 19:36:23 +02:00
Josh Ponelat ec86ee2df9 uncomment swagger-oauth and add script 2015-04-29 12:41:08 +02:00
Josh Ponelat 558cc92dd6 add jshint to gulp..lint and dist 2015-04-29 11:29:19 +02:00
Tony Tam 69bf18a222 Merge pull request #1192 from ponelat/fix/issue-1191
fix #1191, forgot to put returns on handlebar helper
2015-04-28 07:00:23 -07:00
Josh Ponelat f4b2c49eb5 fix #1191, forgot to put returns on handlebar helper 2015-04-22 09:00:50 +02:00
Tony Tam d76a62caf7 Merge pull request #1180 from mgttlinger/develop_2.0
Fix for #1113
2015-04-20 22:09:00 -07:00
Mohsen Azimi 6f1b9b6394 Merge pull request #1182 from delphian/master
Forcing old images to not be CRLF conformed due to new gitattributes file
2015-04-18 15:59:49 -07:00
Bryan Hazelbaker 52cf2ed337 Forcing old images to not be CRLF conformed due to new gitattributes file. 2015-04-17 14:15:40 -07:00
Merlin Göttlinger 5b72632cb6 created files in dist 2015-04-17 19:09:46 +02:00
mgttlinger 29b9f48e5c Fix for #1113 2015-04-17 15:49:03 +02:00
Tony Tam 82a89a7952 updated version 2015-04-16 12:34:25 -07:00
Björn Rochel 569830b4ac Use jQuery for trimming 2015-04-16 20:37:19 +02:00
Bjoern Rochel 6a1707e3ba Prevent the OperationView to display an error in case the response contains a whitespace only body with content type application/json 2015-04-16 11:59:27 +02:00
Waldek Kozba ad56131a6d Corrected for Travis build. 2015-04-03 19:02:19 +00:00
Waldek Kozba af39ae0603 Multiple values for array type parameters as separated lines in the textarea.
Improved required parameter handling for the array type.
Improved default value handling for the array type.
2015-04-03 14:31:23 +00:00
aurelian c84202c1d7 Pass empty object to guard the case when options.swaggerOptions is undefined 2015-04-02 11:27:28 +02:00
aurelian 4764d33fe5 Pass swagger options to swagger-js Operation#execute method 2015-04-01 23:54:14 +02:00
64 changed files with 14959 additions and 2949 deletions
+2
View File
@@ -9,3 +9,5 @@ dist/**/*.woff binary
dist/**/*.woff2 binary
dist/**/*.png binary
dist/*.html text
src/main/html/images/*.png binary
-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.
+1 -1
View File
@@ -1,5 +1,5 @@
###
# swagger-ui-builder - https://github.com/wordnik/swagger-ui/
# swagger-ui-builder - https://github.com/swagger-api/swagger-ui/
# Container for building the swagger-ui static site
#
# Build: docker build -t swagger-ui-builder .
+1 -1
View File
@@ -1,4 +1,4 @@
Copyright 2015 Reverb Technologies, Inc.
Copyright 2015 SmartBear Software
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
+7 -5
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-M2 | 2015-04-16 | 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) |
@@ -96,8 +96,9 @@ operationsSorter | Apply a sort to the operation list of each API. It can be 'al
onComplete | This is a callback function parameter which can be passed to be notified of when SwaggerUI has completed rendering successfully.
onFailure | This is a callback function parameter which can be passed to be notified of when SwaggerUI encountered a failure was unable to render.
highlightSizeThreshold | Any size response below this threshold will be highlighted syntactically, attempting to highlight large responses can lead to browser hangs, not including a threshold will default to highlight all returned responses.
supportedSubmitMethods | An array of of the HTTP operations that will have the 'Try it out!` option. An empty array disables all operations. This does not filter the operations from the display.
supportedSubmitMethods | An array of of the HTTP operations that will have the 'Try it out!' option. An empty array disables all operations. This does not filter the operations from the display.
oauth2RedirectUrl | OAuth redirect URL
showRequestHeaders | Whether or not to show the headers that were sent when making a request via the 'Try it out!' option. Defaults to `false`.
* All other parameters are explained in greater detail below
@@ -131,7 +132,7 @@ swaggerUi.api.clientAuthorizations.add("key", new SwaggerClient.ApiKeyAuthorizat
Note! You can pass multiple header params on a single request, just use unique names for them (`key` is used in the above example).
### Localization and translation
The localization files are in the dist/lang directory.
The localization files are in the [lang](/lang) directory. Note that language files and translator is not included in SwaggerUI by default. You need to add them manually.
To enable translation you should append next two lines in your Swagger's index.html (or another entry point you use)
```html
@@ -156,6 +157,7 @@ or <anyHtmlTag data-sw-translate value='new sentence'/>
At this moment only inner html, title-attribute and value-attribute are going to be translated.
## CORS Support
### OR: How to deal with "Can't read from server. It may not have the appropriate access-control-origin settings."
CORS is a technique to prevent websites from doing bad things with your personal data. Most browsers + javascript toolkits not only support CORS but enforce it, which has implications for your API server which supports Swagger.
@@ -223,11 +225,11 @@ 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
Copyright 2011-2015 Reverb technologies, Inc.
Copyright 2011-2015 SmartBear Software
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
+1 -2
View File
@@ -1,7 +1,6 @@
{
"name": "swagger-ui",
"main": "dist/index.html",
"version": "2.1.8-M1",
"authors": [
"Mohsen Azimi <me@azimi.me>"
],
@@ -13,7 +12,7 @@
"Swagger",
"API"
],
"license": "Copyright 2015 Reverb Technologies, Inc.",
"license": "Copyright 2015 SmartBear Software",
"homepage": "http://swagger.io",
"private": true,
"ignore": [
+17
View File
@@ -274,6 +274,9 @@
font-weight: bold;
font-size: 25px;
}
.swagger-section .swagger-ui-wrap .footer {
margin-top: 20px;
}
.swagger-section .swagger-ui-wrap p.big,
.swagger-section .swagger-ui-wrap div.big p {
font-size: 1em;
@@ -423,6 +426,17 @@
.swagger-section .swagger-ui-wrap .model-signature .description .propWrap .optionsWrapper .optionName {
font-weight: bold;
}
.swagger-section .swagger-ui-wrap .model-signature .description .propDesc.markdown > p:first-child,
.swagger-section .swagger-ui-wrap .model-signature .description .propDesc.markdown > p:last-child {
display: inline;
}
.swagger-section .swagger-ui-wrap .model-signature .description .propDesc.markdown > p:not(:first-child):before {
display: block;
content: '';
}
.swagger-section .swagger-ui-wrap .model-signature .description span:last-of-type.propDesc.markdown > p:only-child {
margin-right: -3px;
}
.swagger-section .swagger-ui-wrap .model-signature .propName {
font-weight: bold;
}
@@ -1066,6 +1080,9 @@
.swagger-section .swagger-ui-wrap form.form_box p strong {
color: black;
}
.swagger-section .swagger-ui-wrap .operation-status td.markdown > p:last-child {
padding-bottom: 0;
}
.swagger-section .title {
font-style: bold;
}
+35 -12
View File
@@ -274,6 +274,9 @@
font-weight: bold;
font-size: 25px;
}
.swagger-section .swagger-ui-wrap .footer {
margin-top: 20px;
}
.swagger-section .swagger-ui-wrap p.big,
.swagger-section .swagger-ui-wrap div.big p {
font-size: 1em;
@@ -423,6 +426,17 @@
.swagger-section .swagger-ui-wrap .model-signature .description .propWrap .optionsWrapper .optionName {
font-weight: bold;
}
.swagger-section .swagger-ui-wrap .model-signature .description .propDesc.markdown > p:first-child,
.swagger-section .swagger-ui-wrap .model-signature .description .propDesc.markdown > p:last-child {
display: inline;
}
.swagger-section .swagger-ui-wrap .model-signature .description .propDesc.markdown > p:not(:first-child):before {
display: block;
content: '';
}
.swagger-section .swagger-ui-wrap .model-signature .description span:last-of-type.propDesc.markdown > p:only-child {
margin-right: -3px;
}
.swagger-section .swagger-ui-wrap .model-signature .propName {
font-weight: bold;
}
@@ -1066,6 +1080,9 @@
.swagger-section .swagger-ui-wrap form.form_box p strong {
color: black;
}
.swagger-section .swagger-ui-wrap .operation-status td.markdown > p:last-child {
padding-bottom: 0;
}
.swagger-section .title {
font-style: bold;
}
@@ -1138,8 +1155,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;
@@ -1150,34 +1175,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 {
+250
View File
@@ -0,0 +1,250 @@
.swagger-section #header a#logo {
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 {
font-size: 80px;
font-family: 'Roboto', sans-serif;
color: #ffffff;
float: right;
margin-right: 20%;
}
.navbar-fixed-top .navbar-nav {
height: auto;
}
.navbar-fixed-top .navbar-brand {
height: auto;
}
.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;
}
/* tag titles */
.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: black;
}
.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading h2 {
color: #525252;
padding-left: 0px;
display: block;
clear: none;
float: left;
font-family: 'Arvo', serif;
font-weight: bold;
}
.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: rgba(223, 227, 228, 0.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 {
color: #08b;
}
.navbar-default .nav > li > a,
.navbar-default .nav > li > a:hover {
color: #08b;
}
.navbar-default .nav > li > a,
.navbar-default .nav > li > a:focus: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: rgba(255, 255, 255, 0.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: 1000;
}
.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: 0.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 {
font-size: 15px;
font-family: 'Arvo', serif;
}
.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: bold;
color: #08b;
}
.navbar-default .nav > li .details {
color: #000000;
text-transform: none;
font-size: 15px;
font-weight: normal;
font-family: 'Open Sans', sans-serif;
font-style: italic;
line-height: 20px;
top: -2px;
}
.navbar-default .nav > li .details:hover {
color: black;
}
#signout {
width: 100%;
height: 32px;
font-size: 13px;
font-weight: bold;
color: #08b;
}
+23 -7
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" />
@@ -19,6 +20,12 @@
<script src='swagger-ui.js' type='text/javascript'></script>
<script src='lib/highlight.7.3.pack.js' type='text/javascript'></script>
<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 () {
@@ -28,19 +35,28 @@
} 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",
supportedSubmitMethods: ['get', 'post', 'put', 'delete', 'patch'],
onComplete: function(swaggerApi, swaggerUi){
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) {
@@ -53,7 +69,8 @@
log("Unable to Load SwaggerUI");
},
docExpansion: "none",
sorter : "alpha"
apisSorter: "alpha",
showRequestHeaders: false
});
function addApiKeyAuthorization(){
@@ -71,7 +88,6 @@
/*
var apiKey = "myApiKeyXXXX123456789";
$('#input_apiKey').val(apiKey);
addApiKeyAuthorization();
*/
window.swaggerUi.load();
@@ -92,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":"сервер сказал"
});
+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;
}
};
+13 -7
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');
@@ -281,4 +287,4 @@ window.onOAuthComplete = function onOAuthComplete(token) {
}
}
}
}
}
+12997 -2550
View File
File diff suppressed because one or more lines are too long
+14 -8
View File
File diff suppressed because one or more lines are too long
+19 -2
View File
@@ -15,6 +15,7 @@ var connect = require('gulp-connect');
var header = require('gulp-header');
var pkg = require('./package.json');
var order = require('gulp-order');
var jshint = require('gulp-jshint');
var banner = ['/**',
' * <%= pkg.name %> - <%= pkg.description %>',
' * @version v<%= pkg.version %>',
@@ -48,10 +49,19 @@ function templates() {
.on('error', log);
}
/**
* JShint all *.js files
*/
gulp.task('lint', function () {
return gulp.src('./src/main/javascript/**/*.js')
.pipe(jshint())
.pipe(jshint.reporter('jshint-stylish'));
});
/**
* Build a distribution
*/
gulp.task('dist', ['clean'], function() {
gulp.task('dist', ['clean','lint'], function() {
return es.merge(
gulp.src([
@@ -82,7 +92,8 @@ gulp.task('less', ['clean'], function() {
.src([
'./src/main/less/screen.less',
'./src/main/less/print.less',
'./src/main/less/reset.less'
'./src/main/less/reset.less',
'./src/main/less/style.less'
])
.pipe(less())
.on('error', log)
@@ -102,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/**/*'])
+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":"сервер сказал"
});
+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;
}
};
+13 -7
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');
@@ -281,4 +287,4 @@ window.onOAuthComplete = function onOAuthComplete(token) {
}
}
}
}
}
+12 -7
View File
@@ -1,14 +1,17 @@
{
"name": "swagger-ui",
"author": "Tony Tam <fehguy@gmail.com>",
"contributors": [{
"name": "Mohsen Azimi",
"email": "me@azimi.me"
}],
"contributors": [
{
"name": "Mohsen Azimi",
"email": "me@azimi.me"
}
],
"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.1-M2",
"version": "2.1.2",
"homepage": "http://swagger.io",
"license": "Apache 2.0",
"license": "Apache-2.0",
"main": "dist/swagger-ui.js",
"scripts": {
"build": "gulp",
"serve": "gulp serve",
@@ -35,6 +38,7 @@
"gulp-declare": "^0.3.0",
"gulp-handlebars": "^3.0.1",
"gulp-header": "^1.2.2",
"gulp-jshint": "^1.10.0",
"gulp-less": "^3.0.1",
"gulp-order": "^1.1.1",
"gulp-rename": "^1.2.0",
@@ -42,9 +46,10 @@
"gulp-watch": "^4.1.1",
"gulp-wrap": "^0.11.0",
"http-server": "git+https://github.com/nodeapps/http-server.git",
"jshint-stylish": "^1.0.1",
"less": "^2.4.0",
"mocha": "^2.1.0",
"selenium-webdriver": "^2.45.0",
"swagger-client": "2.1.2-M2"
"swagger-client": "2.1.3"
}
}
+17
View File
@@ -274,6 +274,9 @@
font-weight: bold;
font-size: 25px;
}
.swagger-section .swagger-ui-wrap .footer {
margin-top: 20px;
}
.swagger-section .swagger-ui-wrap p.big,
.swagger-section .swagger-ui-wrap div.big p {
font-size: 1em;
@@ -423,6 +426,17 @@
.swagger-section .swagger-ui-wrap .model-signature .description .propWrap .optionsWrapper .optionName {
font-weight: bold;
}
.swagger-section .swagger-ui-wrap .model-signature .description .propDesc.markdown > p:first-child,
.swagger-section .swagger-ui-wrap .model-signature .description .propDesc.markdown > p:last-child {
display: inline;
}
.swagger-section .swagger-ui-wrap .model-signature .description .propDesc.markdown > p:not(:first-child):before {
display: block;
content: '';
}
.swagger-section .swagger-ui-wrap .model-signature .description span:last-of-type.propDesc.markdown > p:only-child {
margin-right: -3px;
}
.swagger-section .swagger-ui-wrap .model-signature .propName {
font-weight: bold;
}
@@ -1066,6 +1080,9 @@
.swagger-section .swagger-ui-wrap form.form_box p strong {
color: black;
}
.swagger-section .swagger-ui-wrap .operation-status td.markdown > p:last-child {
padding-bottom: 0;
}
.swagger-section .title {
font-style: bold;
}
+35 -12
View File
@@ -274,6 +274,9 @@
font-weight: bold;
font-size: 25px;
}
.swagger-section .swagger-ui-wrap .footer {
margin-top: 20px;
}
.swagger-section .swagger-ui-wrap p.big,
.swagger-section .swagger-ui-wrap div.big p {
font-size: 1em;
@@ -423,6 +426,17 @@
.swagger-section .swagger-ui-wrap .model-signature .description .propWrap .optionsWrapper .optionName {
font-weight: bold;
}
.swagger-section .swagger-ui-wrap .model-signature .description .propDesc.markdown > p:first-child,
.swagger-section .swagger-ui-wrap .model-signature .description .propDesc.markdown > p:last-child {
display: inline;
}
.swagger-section .swagger-ui-wrap .model-signature .description .propDesc.markdown > p:not(:first-child):before {
display: block;
content: '';
}
.swagger-section .swagger-ui-wrap .model-signature .description span:last-of-type.propDesc.markdown > p:only-child {
margin-right: -3px;
}
.swagger-section .swagger-ui-wrap .model-signature .propName {
font-weight: bold;
}
@@ -1066,6 +1080,9 @@
.swagger-section .swagger-ui-wrap form.form_box p strong {
color: black;
}
.swagger-section .swagger-ui-wrap .operation-status td.markdown > p:last-child {
padding-bottom: 0;
}
.swagger-section .title {
font-style: bold;
}
@@ -1138,8 +1155,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;
@@ -1150,34 +1175,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 {
+250
View File
@@ -0,0 +1,250 @@
.swagger-section #header a#logo {
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 {
font-size: 80px;
font-family: 'Roboto', sans-serif;
color: #ffffff;
float: right;
margin-right: 20%;
}
.navbar-fixed-top .navbar-nav {
height: auto;
}
.navbar-fixed-top .navbar-brand {
height: auto;
}
.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;
}
/* tag titles */
.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: black;
}
.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading h2 {
color: #525252;
padding-left: 0px;
display: block;
clear: none;
float: left;
font-family: 'Arvo', serif;
font-weight: bold;
}
.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: rgba(223, 227, 228, 0.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 {
color: #08b;
}
.navbar-default .nav > li > a,
.navbar-default .nav > li > a:hover {
color: #08b;
}
.navbar-default .nav > li > a,
.navbar-default .nav > li > a:focus: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: rgba(255, 255, 255, 0.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: 1000;
}
.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: 0.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 {
font-size: 15px;
font-family: 'Arvo', serif;
}
.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: bold;
color: #08b;
}
.navbar-default .nav > li .details {
color: #000000;
text-transform: none;
font-size: 15px;
font-weight: normal;
font-family: 'Open Sans', sans-serif;
font-style: italic;
line-height: 20px;
top: -2px;
}
.navbar-default .nav > li .details:hover {
color: black;
}
#signout {
width: 100%;
height: 32px;
font-size: 13px;
font-weight: bold;
color: #08b;
}
+23 -7
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" />
@@ -19,6 +20,12 @@
<script src='swagger-ui.js' type='text/javascript'></script>
<script src='lib/highlight.7.3.pack.js' type='text/javascript'></script>
<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 () {
@@ -28,19 +35,28 @@
} 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",
supportedSubmitMethods: ['get', 'post', 'put', 'delete', 'patch'],
onComplete: function(swaggerApi, swaggerUi){
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) {
@@ -53,7 +69,8 @@
log("Unable to Load SwaggerUI");
},
docExpansion: "none",
sorter : "alpha"
apisSorter: "alpha",
showRequestHeaders: false
});
function addApiKeyAuthorization(){
@@ -71,7 +88,6 @@
/*
var apiKey = "myApiKeyXXXX123456789";
$('#input_apiKey').val(apiKey);
addApiKeyAuthorization();
*/
window.swaggerUi.load();
@@ -92,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>
+20 -7
View File
@@ -13,6 +13,9 @@ window.SwaggerUi = Backbone.Router.extend({
// SwaggerUi accepts all the same options as SwaggerApi
initialize: function(options) {
options = options || {};
if(!options.highlightSizeThreshold) {
options.highlightSizeThreshold = 100000;
}
// Allow dom_id to be overridden
if (options.dom_id) {
@@ -87,7 +90,9 @@ window.SwaggerUi = Backbone.Router.extend({
if (url && url.indexOf('http') !== 0) {
url = this.buildUrl(window.location.href.toString(), url);
}
if(this.api) {
this.options.authorizations = this.api.clientAuthorizations.authz;
}
this.options.url = url;
this.headerView.update(url);
@@ -168,9 +173,13 @@ window.SwaggerUi = Backbone.Router.extend({
if (data === undefined) {
data = '';
}
$('#message-bar').removeClass('message-fail');
$('#message-bar').addClass('message-success');
$('#message-bar').html(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
@@ -181,7 +190,7 @@ window.SwaggerUi = Backbone.Router.extend({
$('#message-bar').removeClass('message-success');
$('#message-bar').addClass('message-fail');
var val = $('#message-bar').html(data);
var val = $('#message-bar').text(data);
if (this.options.onFailure) {
this.options.onFailure(data);
@@ -195,6 +204,10 @@ window.SwaggerUi = Backbone.Router.extend({
$('.markdown').each(function(){
$(this).html(marked($(this).html()));
});
$('.propDesc', '.model-signature .description').each(function () {
$(this).html(marked($(this).html())).addClass('markdown');
});
}
});
@@ -244,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 {
@@ -253,4 +266,4 @@ window.SwaggerUi.Views = {};
}
}(this, function () {
return SwaggerUi;
}));
}));
+6 -4
View File
@@ -93,11 +93,13 @@ window.Docs = {
switch (fragments.length) {
case 1:
// Expand all operations for the resource and scroll to it
var dom_id = 'resource_' + fragments[0];
if (fragments[0].length > 0) { // prevent matching "#/"
// Expand all operations for the resource and scroll to it
var dom_id = 'resource_' + fragments[0];
Docs.expandEndpointListForResource(fragments[0]);
$("#"+dom_id).slideto({highlight: false});
Docs.expandEndpointListForResource(fragments[0]);
$("#"+dom_id).slideto({highlight: false});
}
break;
case 2:
// Refer to the endpoint DOM element, e.g. #words_get_search
+42 -1
View File
@@ -4,4 +4,45 @@ Handlebars.registerHelper('sanitize', function(html) {
// Strip the script tags from the html, and return it as a Handlebars.SafeString
html = html.replace(/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi, '');
return new Handlebars.SafeString(html);
});
});
Handlebars.registerHelper('renderTextParam', function(param) {
var result, type = 'text', idAtt = '';
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 = '';
}
if(param.format && param.format === 'password') {
type = 'password';
}
if(param.valueId) {
idAtt = ' id=\'' + param.valueId + '\'';
}
if(isArray) {
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 {
var parameterClass = 'parameter';
if(param.required) {
parameterClass += ' required';
}
result = '<input class=\'' + parameterClass + '\' minlength=\'' + (param.required ? 1 : 0) + '\'';
result += ' name=\'' + param.name +'\' placeholder=\'' + (param.required ? '(required)' : '') + '\'' + idAtt + dataVendorExtensions;
result += ' type=\'' + type + '\' value=\'' + defaultValue + '\'/>';
}
return new Handlebars.SafeString(result);
});
+1 -3
View File
@@ -4,10 +4,8 @@ SwaggerUi.Views.ContentTypeView = Backbone.View.extend({
initialize: function() {},
render: function(){
this.model.contentTypeId = 'ct' + Math.random();
$(this.el).html(Handlebars.templates.content_type(this.model));
$('label[for=contentType]', $(this.el)).text('Response Content Type');
return this;
}
});
-7
View File
@@ -3,7 +3,6 @@
SwaggerUi.Views.HeaderView = Backbone.View.extend({
events: {
'click #show-pet-store-icon' : 'showPetStore',
'click #show-wordnik-dev-icon' : 'showWordnikDev',
'click #explore' : 'showCustom',
'keyup #input_baseUrl' : 'showCustomOnKeyup',
'keyup #input_apiKey' : 'showCustomOnKeyup'
@@ -17,12 +16,6 @@ SwaggerUi.Views.HeaderView = Backbone.View.extend({
});
},
showWordnikDev: function(){
this.trigger('update-swagger-ui', {
url: 'http://api.wordnik.com/v4/resources.json'
});
},
showCustomOnKeyup: function(e){
if (e.keyCode === 13) {
this.showCustom();
+14 -16
View File
@@ -54,21 +54,19 @@ SwaggerUi.Views.MainView = Backbone.View.extend({
});
}
if (this.model.swaggerVersion === '2.0') {
if ('validatorUrl' in opts.swaggerOptions) {
// Validator URL specified explicitly
this.model.validatorUrl = opts.swaggerOptions.validatorUrl;
} else if (this.model.url.indexOf('localhost') > 0) {
// Localhost override
this.model.validatorUrl = null;
} else {
// Default validator
this.model.validatorUrl = window.location.protocol + '//online.swagger.io/validator';
if ('validatorUrl' in opts.swaggerOptions) {
// Validator URL specified explicitly
this.model.validatorUrl = opts.swaggerOptions.validatorUrl;
} else if (this.model.url.indexOf('localhost') > 0) {
// Localhost override
this.model.validatorUrl = null;
} else {
// Default validator
if(window.location.protocol === 'https:') {
this.model.validatorUrl = 'https://online.swagger.io/validator';
}
else {
this.model.validatorUrl = 'http://online.swagger.io/validator';
}
}
},
@@ -130,7 +128,7 @@ SwaggerUi.Views.MainView = Backbone.View.extend({
auths: auths,
swaggerOptions: this.options.swaggerOptions
});
$('#resources').append(resourceView.render().el);
$('#resources', this.el).append(resourceView.render().el);
},
clear: function(){
+173 -130
View File
@@ -9,7 +9,7 @@ SwaggerUi.Views.OperationView = Backbone.View.extend({
'click .response_hider' : 'hideResponse',
'click .toggleOperation' : 'toggleOperationContent',
'mouseenter .api-ic' : 'mouseEnter',
'mouseout .api-ic' : 'mouseExit',
'dblclick .curl' : 'selectText',
},
initialize: function(opts) {
@@ -22,6 +22,24 @@ SwaggerUi.Views.OperationView = Backbone.View.extend({
return this;
},
selectText: function(event) {
var doc = document,
text = event.target.firstChild,
range,
selection;
if (doc.body.createTextRange) {
range = document.body.createTextRange();
range.moveToElementText(text);
range.select();
} else if (window.getSelection) {
selection = window.getSelection();
range = document.createRange();
range.selectNodeContents(text);
selection.removeAllRanges();
selection.addRange(range);
}
},
mouseEnter: function(e) {
var elem = $(this.el).find('.content');
var x = e.pageX;
@@ -53,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
@@ -76,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);
}
}
}
}
@@ -125,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({
@@ -160,6 +174,10 @@ SwaggerUi.Views.OperationView = Backbone.View.extend({
signature: this.model.responseClassSignature
};
}
var opts = this.options.swaggerOptions;
if (opts.showRequestHeaders) {
this.model.showRequestHeaders = true;
}
$(this.el).html(Handlebars.templates.operation(this.model));
if (signatureModel) {
responseSignatureView = new SwaggerUi.Views.SignatureView({
@@ -241,7 +259,7 @@ SwaggerUi.Views.OperationView = Backbone.View.extend({
// Note: copied from CoffeeScript compiled file
// TODO: redactor
submitOperation: function(e) {
var error_free, form, isFileUpload, l, len, len1, len2, m, map, n, o, opts, ref1, ref2, ref3, val;
var error_free, form, isFileUpload, map, opts;
if (e !== null) {
e.preventDefault();
}
@@ -275,126 +293,99 @@ SwaggerUi.Views.OperationView = Backbone.View.extend({
error_free = false;
}
});
form.find('select.required').each(function() {
$(this).removeClass('error');
if (this.selectedIndex === -1) {
$(this).addClass('error');
$(this).wiggle({
callback: (function(_this) {
return function() {
$(_this).focus();
};
})(this)
});
error_free = false;
}
});
if (error_free) {
map = {};
map = this.getInputMap(form);
isFileUpload = this.isFileUpload(form);
opts = {
parent: this
};
isFileUpload = false;
ref1 = form.find('input');
for (l = 0, len = ref1.length; l < len; l++) {
o = ref1[l];
if ((o.value !== null) && jQuery.trim(o.value).length > 0) {
map[o.name] = o.value;
}
if (o.type === 'file') {
map[o.name] = o.files[0];
isFileUpload = true;
}
}
ref2 = form.find('textarea');
for (m = 0, len1 = ref2.length; m < len1; m++) {
o = ref2[m];
if ((o.value !== null) && jQuery.trim(o.value).length > 0) {
map[o.name] = o.value;
}
}
ref3 = form.find('select');
for (n = 0, len2 = ref3.length; n < len2; n++) {
o = ref3[n];
val = this.getSelectedValue(o);
if ((val !== null) && jQuery.trim(val).length > 0) {
map[o.name] = val;
if (this.options.swaggerOptions) {
for(var key in this.options.swaggerOptions) {
opts[key] = this.options.swaggerOptions[key];
}
}
opts.responseContentType = $('div select[name=responseContentType]', $(this.el)).val();
opts.requestContentType = $('div select[name=parameterContentType]', $(this.el)).val();
$('.response_throbber', $(this.el)).show();
if (isFileUpload) {
return this.handleFileUpload(map, form);
$('.request_url', $(this.el)).html('<pre></pre>');
$('.request_url pre', $(this.el)).text(this.invocationUrl);
opts.useJQuery = true;
map.parameterContentType = 'multipart/form-data';
return this.model.execute(map, opts, this.showCompleteStatus, this.showErrorStatus, this);
} else {
return this.model['do'](map, opts, this.showCompleteStatus, this.showErrorStatus, this);
this.map = map;
return this.model.execute(map, opts, this.showCompleteStatus, this.showErrorStatus, this);
}
}
},
getInputMap: function (form) {
var map, ref1, l, len, o, ref2, m, len1, val, ref3, n, len2;
map = {};
ref1 = form.find('input');
for (l = 0, len = ref1.length; l < len; l++) {
o = ref1[l];
if ((o.value !== null) && jQuery.trim(o.value).length > 0) {
map[o.name] = o.value;
}
if (o.type === 'file') {
map[o.name] = o.files[0];
}
}
ref2 = form.find('textarea');
for (m = 0, len1 = ref2.length; m < len1; m++) {
o = ref2[m];
val = this.getTextAreaValue(o);
if ((val !== null) && jQuery.trim(val).length > 0) {
map[o.name] = val;
}
}
ref3 = form.find('select');
for (n = 0, len2 = ref3.length; n < len2; n++) {
o = ref3[n];
val = this.getSelectedValue(o);
if ((val !== null) && jQuery.trim(val).length > 0) {
map[o.name] = val;
}
}
return map;
},
isFileUpload: function (form) {
var ref1, l, len, o;
var isFileUpload = false;
ref1 = form.find('input');
for (l = 0, len = ref1.length; l < len; l++) {
o = ref1[l];
if (o.type === 'file') {
isFileUpload = true;
}
}
return isFileUpload;
},
success: function(response, parent) {
parent.showCompleteStatus(response);
},
// Note: This is compiled code
// TODO: Refactor
handleFileUpload: function(map, form) {
var bodyParam, el, headerParams, l, len, len1, len2, len3, m, n, o, p, param, params, ref1, ref2, ref3, ref4;
ref1 = form.serializeArray();
for (l = 0, len = ref1.length; l < len; l++) {
o = ref1[l];
if ((o.value !== null) && jQuery.trim(o.value).length > 0) {
map[o.name] = o.value;
}
}
bodyParam = new FormData();
params = 0;
ref2 = this.model.parameters;
for (m = 0, len1 = ref2.length; m < len1; m++) {
param = ref2[m];
if (param.paramType === 'form' || param['in'] === 'formData') {
if (param.type.toLowerCase() !== 'file' && map[param.name] !== void 0) {
bodyParam.append(param.name, map[param.name]);
}
}
}
headerParams = {};
ref3 = this.model.parameters;
for (n = 0, len2 = ref3.length; n < len2; n++) {
param = ref3[n];
if (param.paramType === 'header') {
headerParams[param.name] = map[param.name];
}
}
ref4 = form.find('input[type~="file"]');
for (p = 0, len3 = ref4.length; p < len3; p++) {
el = ref4[p];
if (typeof el.files[0] !== 'undefined') {
bodyParam.append($(el).attr('name'), el.files[0]);
params += 1;
}
}
this.invocationUrl = this.model.supportHeaderParams() ? (headerParams = this.model.getHeaderParams(map), delete headerParams['Content-Type'], this.model.urlify(map, false)) : this.model.urlify(map, true);
$('.request_url', $(this.el)).html('<pre></pre>');
$('.request_url pre', $(this.el)).text(this.invocationUrl);
// TODO: don't use jQuery. Use SwaggerJS for handling the call.
var obj = {
type: this.model.method,
url: this.invocationUrl,
headers: headerParams,
data: bodyParam,
dataType: 'json',
contentType: false,
processData: false,
error: (function(_this) {
return function(data) {
return _this.showErrorStatus(_this.wrap(data), _this);
};
})(this),
success: (function(_this) {
return function(data) {
return _this.showResponse(data, _this);
};
})(this),
complete: (function(_this) {
return function(data) {
return _this.showCompleteStatus(_this.wrap(data), _this);
};
})(this)
};
jQuery.ajax(obj);
return false;
// end of file-upload nastiness
},
// wraps a jquery response as a shred response
wrap: function(data) {
var h, headerArray, headers, i, l, len, o;
headers = {};
@@ -549,6 +540,7 @@ SwaggerUi.Views.OperationView = Backbone.View.extend({
url = response.request.url;
}
var headers = response.headers;
content = jQuery.trim(content);
// if server is nice, and sends content-type back, we can use it
var contentType = null;
@@ -608,10 +600,10 @@ SwaggerUi.Views.OperationView = Backbone.View.extend({
pre = $('<audio controls>').append($('<source>').attr('src', url).attr('type', contentType));
// Download
} else if (headers['Content-Disposition'].test(/attachment/) ||
headers['content-disposition'].test(/attachment/) ||
headers['Content-Description'].test(/File Transfer/) ||
headers['content-description'].test(/File Transfer/)) {
} else if (headers['Content-Disposition'] && (/attachment/).test(headers['Content-Disposition']) ||
headers['content-disposition'] && (/attachment/).test(headers['content-disposition']) ||
headers['Content-Description'] && (/File Transfer/).test(headers['Content-Description']) ||
headers['content-description'] && (/File Transfer/).test(headers['content-description'])) {
if ('Blob' in window) {
var type = contentType || 'text/html';
@@ -648,23 +640,74 @@ SwaggerUi.Views.OperationView = Backbone.View.extend({
$('.response', $(this.el)).slideDown();
$('.response_hider', $(this.el)).show();
$('.response_throbber', $(this.el)).hide();
var response_body_el = $('.response_body', $(this.el))[0];
//adds curl output
var curlCommand = this.model.asCurl(this.map);
curlCommand = curlCommand.replace('!', '&#33;');
$( '.curl', $(this.el)).html('<pre>' + curlCommand + '</pre>');
// only highlight the response if response is less than threshold, default state is highlight response
var opts = this.options.swaggerOptions;
if (opts.highlightSizeThreshold && response.data.length > opts.highlightSizeThreshold) {
if (opts.showRequestHeaders) {
var form = $('.sandbox', $(this.el)),
map = this.getInputMap(form),
requestHeaders = this.model.getHeaderParams(map);
delete requestHeaders['Content-Type'];
$('.request_headers', $(this.el)).html('<pre>' + _.escape(JSON.stringify(requestHeaders, null, ' ')).replace(/\n/g, '<br>') + '</pre>');
}
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) {
return response_body_el;
} else {
return hljs.highlightBlock(response_body_el);
}
},
toggleOperationContent: function() {
toggleOperationContent: function (event) {
var elem = $('#' + Docs.escapeResourceName(this.parentId + '_' + this.nickname + '_content'));
if (elem.is(':visible')){
event.preventDefault();
$.bbq.pushState('#/', 2);
Docs.collapseOperation(elem);
} else {
Docs.expandOperation(elem);
}
},
getTextAreaValue: function(textArea) {
var param, parsed, result, i;
if (textArea.value === null || jQuery.trim(textArea.value).length === 0) {
return null;
}
param = this.getParamByName(textArea.name);
if (param && param.type && param.type.toLowerCase() === 'array') {
parsed = textArea.value.split('\n');
result = [];
for (i = 0; i < parsed.length; i++) {
if (parsed[i] !== null && jQuery.trim(parsed[i]).length > 0) {
result.push(parsed[i]);
}
}
return result.length > 0 ? result : null;
} else {
return textArea.value;
}
},
getParamByName: function(name) {
var i;
if (this.model.parameters) {
for(i = 0; i < this.model.parameters.length; i++) {
if (this.model.parameters[i].name === name) {
return this.model.parameters[i];
}
}
}
return null;
}
});
@@ -4,10 +4,8 @@ SwaggerUi.Views.ParameterContentTypeView = Backbone.View.extend({
initialize: function () {},
render: function(){
this.model.parameterContentTypeId = 'pct' + Math.random();
$(this.el).html(Handlebars.templates.parameter_content_type(this.model));
$('label[for=parameterContentType]', $(this.el)).text('Parameter content type:');
return this;
}
+11 -4
View File
@@ -4,9 +4,9 @@ SwaggerUi.Views.ParameterView = Backbone.View.extend({
initialize: function(){
Handlebars.registerHelper('isArray', function(param, opts) {
if (param.type.toLowerCase() === 'array' || param.allowMultiple) {
opts.fn(this);
return opts.fn(this);
} else {
opts.inverse(this);
return opts.inverse(this);
}
});
},
@@ -30,7 +30,14 @@ SwaggerUi.Views.ParameterView = Backbone.View.extend({
this.model.paramType = this.model.in || this.model.paramType;
this.model.isBody = this.model.paramType === 'body' || this.model.in === 'body';
this.model.isFile = type && type.toLowerCase() === 'file';
this.model.default = (this.model.default || this.model.defaultValue);
// Allow for default === false
if(typeof this.model.default === 'undefined') {
this.model.default = this.model.defaultValue;
}
this.model.hasDefault = (typeof this.model.default !== 'undefined');
this.model.valueId = 'm' + this.model.name + Math.random();
if (this.model.allowableValues) {
this.model.isList = true;
@@ -98,4 +105,4 @@ SwaggerUi.Views.ParameterView = Backbone.View.extend({
}
}
}
});
});
@@ -4,10 +4,8 @@ SwaggerUi.Views.ResponseContentTypeView = Backbone.View.extend({
initialize: function(){},
render: function(){
this.model.responseContentTypeId = 'rct' + Math.random();
$(this.el).html(Handlebars.templates.response_content_type(this.model));
$('label[for=responseContentType]', $(this.el)).text('Response Content Type');
return this;
}
});
+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;
}
}
}
+21
View File
@@ -153,6 +153,10 @@
font-size: 25px;
}
.footer {
margin-top: 20px;
}
p.big, div.big p {
font-size: 1em;
margin-bottom: 10px;
@@ -317,6 +321,19 @@
}
}
}
.propDesc.markdown {
> p:first-child,
> p:last-child {
display: inline;
}
> p:not(:first-child):before {
display: block;
content: '';
}
}
span:last-of-type.propDesc.markdown > p:only-child {
margin-right: -3px; // otherwise there is a gap before the comma
}
}
.propName {
font-weight: bold;
@@ -1081,6 +1098,10 @@
}
}
}
.operation-status td.markdown > p:last-child {
padding-bottom: 0;
}
}
}
+311
View File
@@ -0,0 +1,311 @@
.swagger-section #header a#logo {
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{
font-size: 80px;
font-family: 'Roboto', sans-serif;
color: #ffffff;
float: right;
margin-right: 20%;
}
.navbar-fixed-top .navbar-nav {
height:auto;
}
.navbar-fixed-top .navbar-brand {
height: auto;
}
.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;
}
/* tag titles */
.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: black;
}
.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading h2 {
color: #525252;
padding-left: 0px;
display: block;
clear: none;
float: left;
font-family: 'Arvo', serif;
font-weight: bold;
}
.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: rgba(223,227,228, 0.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;
}
.container-fluid {
}
.bg-primary {
background-color: #00468b;
}
.navbar-default .nav > li>a, .navbar-default .nav>li>a:focus {
color: #08b;
}
.navbar-default .nav > li>a, .navbar-default .nav>li>a:hover {
color: #08b;
}
.navbar-default .nav > li>a, .navbar-default .nav>li>a:focus: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: rgba(255,255,255,.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:1000;
}
.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: 0.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 {
font-size: 15px;
font-family: 'Arvo', serif;
}
.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: bold;
color: #08b;
}
.navbar-default .nav > li .details {
color: #000000;
text-transform: none;
font-size: 15px;
font-weight: normal;
font-family: 'Open Sans', sans-serif;
font-style: italic;
line-height: 20px;
top: -2px;
}
.navbar-default .nav > li .details:hover {
color: black;
}
#signout {
width: 100%;
height: 32px;
font-size: 13px;
font-weight: bold;
color: #08b;
}
@@ -1,9 +1,8 @@
<!--div class='auth_button' id='apikey_button'><img class='auth_icon' alt='apply api key' src='images/apikey.jpeg'></div-->
<div class='auth_container' id='apikey_container'>
<div class='key_input_container'>
<div class='auth_label'>{{keyName}}</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_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='#' 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">Username</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">Password</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>
+2 -2
View File
@@ -1,5 +1,5 @@
<label for="contentType"></label>
<select name="contentType">
<label data-sw-translate for="{{contentTypeId}}">Response Content Type</label>
<select name="contentType" id="{{contentTypeId}}">
{{#if produces}}
{{#each produces}}
<option value="{{{this}}}">{{{this}}}</option>
+5 -8
View File
@@ -3,14 +3,13 @@
<div class="info_title">{{info.title}}</div>
<div class="info_description markdown">{{{info.description}}}</div>
{{#if externalDocs}}
<h5>More documentations</h5>
<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>
@@ -18,11 +17,9 @@
<ul id='resources'></ul>
<div class="footer">
<br>
<br>
<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>
+27 -21
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,20 +85,26 @@
{{#if isReadOnly}}
{{else}}
<div class='sandbox_header'>
<input class='submit' name='commit' 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}}
</form>
<div class='response' style='display:none'>
<h4>Request URL</h4>
<h4>Curl</h4>
<div class='block curl'></div>
<h4 data-sw-translate>Request URL</h4>
<div class='block request_url'></div>
<h4>Response Body</h4>
{{#if showRequestHeaders}}
<h4 data-sw-translate>Request Headers</h4>
<div class='block request_headers'></div>
{{/if}}
<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>
+7 -10
View File
@@ -1,31 +1,28 @@
<td class='code'>{{name}}</td>
<td class='code'><label for='{{valueId}}'>{{name}}</label></td>
<td>
{{#if isBody}}
{{#if isFile}}
<input type="file" name='{{name}}'/>
<input type="file" name='{{name}}' id='{{valueId}}'/>
<div class="parameter-content-type" />
{{else}}
{{#if default}}
<textarea class='body-textarea' name='{{name}}'>{{default}}</textarea>
<textarea class='body-textarea' name='{{name}}' id='{{valueId}}'>{{default}}</textarea>
<br />
<div class="parameter-content-type" />
{{else}}
<textarea class='body-textarea' name='{{name}}'></textarea>
<textarea class='body-textarea' name='{{name}}' id='{{valueId}}'></textarea>
<br />
<div class="parameter-content-type" />
{{/if}}
{{/if}}
{{else}}
{{#if isFile}}
<input type="file" name='{{name}}'/>
<input type="file" name='{{name}}' id='{{valueId}}'/>
<div class="parameter-content-type" />
{{else}}
{{#if default}}
<input class='parameter' minlength='0' name='{{name}}' placeholder='' type='text' value='{{default}}'/>
{{else}}
<input class='parameter' minlength='0' name='{{name}}' placeholder='' type='text' value=''/>
{{/if}}
{{#renderTextParam this}}
{{/renderTextParam}}
{{/if}}
{{/if}}
+13 -22
View File
@@ -1,28 +1,19 @@
{{#if required}}
<td class='code required'>{{name}}</td>
{{/if}}
<td class='code'>{{name}}</td>
<td class='code{{#if required}} required{{/if}}'><label for='{{valueId}}'>{{name}}</label></td>
<td>
<select {{#isArray this}} multiple='multiple'{{/isArray}} class='parameter' name='{{name}}'>
{{#if required}}
{{else}}
{{#if default}}
{{else}}
{{#isArray this}}
{{else}}
<option selected="" value=''></option>
{{/isArray}}
{{/if}}
{{/if}}
<select {{#isArray this}} multiple="multiple"{{/isArray}} class="parameter {{#if required}} required {{/if}}" name="{{name}}" id="{{valueId}}">
{{#unless required}}
<option {{#unless hasDefault}} selected="" {{/unless}} value=''></option>
{{/unless}}
{{#each allowableValues.descriptiveValues}}
{{#if isDefault}}
<option selected="" value='{{value}}'>{{value}} (default)</option>
{{else}}
<option value='{{value}}'>{{value}}</option>
{{/if}}
<option {{#if isDefault}} selected="" {{/if}} value='{{value}}'> {{value}} {{#if isDefault}} (default) {{/if}} </option>
{{/each}}
</select>
</td>
<td class="markdown">{{{description}}}</td>
<td class="markdown">{{#if required}}<strong>{{/if}}{{{description}}}{{#if required}}</strong>{{/if}}</td>
<td>{{{paramType}}}</td>
<td><span class="model-signature"></span></td>
<td><span class="model-signature"></span></td>
+2 -2
View File
@@ -1,7 +1,7 @@
<td class='code'>{{name}}</td>
<td class='code'><label for='{{valueId}}'>{{name}}</label></td>
<td>
{{#if isBody}}
<textarea class='body-textarea' readonly='readonly' name='{{name}}'>{{default}}</textarea>
<textarea class='body-textarea' readonly='readonly' name='{{name}}' id='{{valueId}}'>{{default}}</textarea>
{{else}}
{{#if default}}
{{default}}
@@ -1,7 +1,7 @@
<td class='code required'>{{name}}</td>
<td class='code required'><label for='{{valueId}}'>{{name}}</label></td>
<td>
{{#if isBody}}
<textarea class='body-textarea' readonly='readonly' placeholder='(required)' name='{{name}}'>{{default}}</textarea>
<textarea class='body-textarea' readonly='readonly' placeholder='(required)' name='{{name}}' id='{{valueId}}'>{{default}}</textarea>
{{else}}
{{#if default}}
{{default}}
+7 -10
View File
@@ -1,28 +1,25 @@
<td class='code required'>{{name}}</td>
<td class='code required'><label for='{{valueId}}'>{{name}}</label></td>
<td>
{{#if isBody}}
{{#if isFile}}
<input type="file" name='{{name}}'/>
<input type="file" name='{{name}}' id='{{valueId}}'/>
{{else}}
{{#if default}}
<textarea class='body-textarea required' placeholder='(required)' name='{{name}}'>{{default}}</textarea>
<textarea class='body-textarea required' placeholder='(required)' name='{{name}}' id="{{valueId}}">{{default}}</textarea>
<br />
<div class="parameter-content-type" />
{{else}}
<textarea class='body-textarea required' placeholder='(required)' name='{{name}}'></textarea>
<textarea class='body-textarea required' placeholder='(required)' name='{{name}}' id='{{valueId}}'></textarea>
<br />
<div class="parameter-content-type" />
{{/if}}
{{/if}}
{{else}}
{{#if isFile}}
<input class='parameter' class='required' type='file' name='{{name}}'/>
<input class='parameter' class='required' type='file' name='{{name}}' id='{{valueId}}'/>
{{else}}
{{#if default}}
<input class='parameter required' minlength='1' name='{{name}}' placeholder='(required)' type='text' value='{{default}}'/>
{{else}}
<input class='parameter required' minlength='1' name='{{name}}' placeholder='(required)' type='text' value=''/>
{{/if}}
{{#renderTextParam this}}
{{/renderTextParam}}
{{/if}}
{{/if}}
</td>
@@ -1,5 +1,5 @@
<label for="parameterContentType"></label>
<select name="parameterContentType">
<label for="{{parameterContentTypeId}}">Parameter content type:</label>
<select name="parameterContentType" id="{{parameterContentTypeId}}">
{{#if consumes}}
{{#each consumes}}
<option value="{{{this}}}">{{{this}}}</option>
+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,5 +1,5 @@
<label for="responseContentType"></label>
<select name="responseContentType">
<label data-sw-translate for="{{responseContentTypeId}}">Response Content Type</label>
<select name="responseContentType" id="{{responseContentTypeId}}">
{{#if produces}}
{{#each produces}}
<option value="{{{this}}}">{{{this}}}</option>
+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>
+1 -1
View File
@@ -1,5 +1,5 @@
<td width='15%' class='code'>{{code}}</td>
<td>{{{message}}}</td>
<td class="markdown">{{{message}}}</td>
<td width='50%'><span class="model-signature" /></td>
<td class="headers">
<table>
+1 -1
View File
@@ -29,7 +29,7 @@ module.exports.start = function (specsLocation, done) {
setTimeout(function(){
driver.get(url);
done();
}, process.env.TRAVIS ? 20000 : 3000);
}, process.env.TRAVIS ? 20000 : 5000);
};
module.exports.close = function() {
+4 -7
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) {
@@ -102,4 +99,4 @@ describe('swagger 1.x spec tests', function () {
after(function(){
servers.close();
});
});
});
+4 -8
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',
@@ -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) {
@@ -117,4 +113,4 @@ describe('swagger 2.0 spec tests', function () {
after(function() {
servers.close();
});
});
});
+1 -1
View File
@@ -52,7 +52,7 @@
"info": {
"title": "Swagger Sample App",
"description": "This is a sample server Petstore server. You can find out more about Swagger \n at <a href=\"http://swagger.io\">http://swagger.io</a> or on irc.freenode.net, #swagger. For this sample,\n you can use the api key \"special-key\" to test the authorization filters",
"termsOfServiceUrl": "http://helloreverb.com/terms/",
"termsOfServiceUrl": "http://swagger.io/terms/",
"contact": "apiteam@swagger.io",
"license": "Apache 2.0",
"licenseUrl": "http://www.apache.org/licenses/LICENSE-2.0.html"
+3 -2
View File
@@ -4,7 +4,7 @@
"description": "This is a sample server Petstore server. You can find out more about Swagger at <a href=\"http://swagger.io\">http://swagger.io</a> or on irc.freenode.net, #swagger. For this sample, you can use the api key \"special-key\" to test the authorization filters",
"version": "1.0.0",
"title": "Swagger Petstore",
"termsOfService": "http://helloreverb.com/terms/",
"termsOfService": "http://swagger.io/terms/",
"contact": {
"url": "http://swagger.io",
"name": "Your pals at Swagger",
@@ -594,7 +594,8 @@
"name": "password",
"description": "The password for login in clear text",
"required": false,
"type": "string"
"type": "string",
"format": "password"
}
],
"responses": {