Skip to content

Commit d919a5e

Browse files
committed
Merge branch 'bodnia-master'
2 parents 7071fca + 5dc1eae commit d919a5e

File tree

6 files changed

+170
-26
lines changed

6 files changed

+170
-26
lines changed

dist/lang/pl.js

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
'use strict';
2+
3+
/* jshint quotmark: double */
4+
window.SwaggerTranslator.learn({
5+
"Warning: Deprecated":"Uwaga: Wycofane",
6+
"Implementation Notes":"Uwagi Implementacji",
7+
"Response Class":"Klasa Odpowiedzi",
8+
"Status":"Status",
9+
"Parameters":"Parametry",
10+
"Parameter":"Parametr",
11+
"Value":"Wartość",
12+
"Description":"Opis",
13+
"Parameter Type":"Typ Parametru",
14+
"Data Type":"Typ Danych",
15+
"Response Messages":"Wiadomości Odpowiedzi",
16+
"HTTP Status Code":"Kod Statusu HTTP",
17+
"Reason":"Przyczyna",
18+
"Response Model":"Model Odpowiedzi",
19+
"Request URL":"URL Wywołania",
20+
"Response Body":"Treść Odpowiedzi",
21+
"Response Code":"Kod Odpowiedzi",
22+
"Response Headers":"Nagłówki Odpowiedzi",
23+
"Hide Response":"Ukryj Odpowiedź",
24+
"Headers":"Nagłówki",
25+
"Try it out!":"Wypróbuj!",
26+
"Show/Hide":"Pokaż/Ukryj",
27+
"List Operations":"Lista Operacji",
28+
"Expand Operations":"Rozwiń Operacje",
29+
"Raw":"Nieprzetworzone",
30+
"can't parse JSON. Raw result":"nie można przetworzyć pliku JSON. Nieprzetworzone dane",
31+
"Model Schema":"Schemat Modelu",
32+
"Model":"Model",
33+
"apply":"użyj",
34+
"Username":"Nazwa użytkownika",
35+
"Password":"Hasło",
36+
"Terms of service":"Warunki używania",
37+
"Created by":"Utworzone przez",
38+
"See more at":"Zobacz więcej na",
39+
"Contact the developer":"Kontakt z deweloperem",
40+
"api version":"wersja api",
41+
"Response Content Type":"Typ Zasobu Odpowiedzi",
42+
"fetching resource":"ładowanie zasobu",
43+
"fetching resource list":"ładowanie listy zasobów",
44+
"Explore":"Eksploruj",
45+
"Show Swagger Petstore Example Apis":"Pokaż Przykładowe Api Swagger Petstore",
46+
"Can't read from server. It may not have the appropriate access-control-origin settings.":"Brak połączenia z serwerem. Może on nie mieć odpowiednich ustawień access-control-origin.",
47+
"Please specify the protocol for":"Proszę podać protokół dla",
48+
"Can't read swagger JSON from":"Nie można odczytać swagger JSON z",
49+
"Finished Loading Resource Information. Rendering Swagger UI":"Ukończono Ładowanie Informacji o Zasobie. Renderowanie Swagger UI",
50+
"Unable to read api":"Nie można odczytać api",
51+
"from path":"ze ścieżki",
52+
"server returned":"serwer zwrócił"
53+
});

dist/lang/ru.js

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
/* jshint quotmark: double */
44
window.SwaggerTranslator.learn({
5-
"Warning: Deprecated":"Ворнинг: Депрекейтед",
5+
"Warning: Deprecated":"Предупреждение: Устарело",
66
"Implementation Notes":"Заметки",
77
"Response Class":"Пример ответа",
88
"Status":"Статус",
@@ -20,6 +20,7 @@ window.SwaggerTranslator.learn({
2020
"Response Code":"HTTP код ответа",
2121
"Response Headers":"Заголовки ответа",
2222
"Hide Response":"Спрятать ответ",
23+
"Headers":"Заголовки",
2324
"Response Messages":"Что может прийти в ответ",
2425
"Try it out!":"Попробовать!",
2526
"Show/Hide":"Показать/Скрыть",
@@ -29,6 +30,7 @@ window.SwaggerTranslator.learn({
2930
"can't parse JSON. Raw result":"Не удается распарсить ответ:",
3031
"Model Schema":"Структура",
3132
"Model":"Описание",
33+
"Click to set as parameter value":"Нажмите, чтобы испльзовать в качестве значения параметра",
3234
"apply":"применить",
3335
"Username":"Имя пользователя",
3436
"Password":"Пароль",
@@ -38,12 +40,13 @@ window.SwaggerTranslator.learn({
3840
"Contact the developer":"Связаться с разработчиком",
3941
"api version":"Версия API",
4042
"Response Content Type":"Content Type ответа",
43+
"Parameter content type:":"Content Type параметра:",
4144
"fetching resource":"Получение ресурса",
4245
"fetching resource list":"Получение ресурсов",
43-
"Explore":"Поехали",
46+
"Explore":"Показать",
4447
"Show Swagger Petstore Example Apis":"Показать примеры АПИ",
45-
"Can't read from server. It may not have the appropriate access-control-origin settings.":"Не удается получить ответ от сервера. Возможно, какая-то лажа с настройками доступа",
46-
"Please specify the protocol for":"Пожалуйста, укажите протогол для",
48+
"Can't read from server. It may not have the appropriate access-control-origin settings.":"Не удается получить ответ от сервера. Возможно, проблема с настройками доступа",
49+
"Please specify the protocol for":"Пожалуйста, укажите протокол для",
4750
"Can't read swagger JSON from":"Не получается прочитать swagger json из",
4851
"Finished Loading Resource Information. Rendering Swagger UI":"Загрузка информации о ресурсах завершена. Рендерим",
4952
"Unable to read api":"Не удалось прочитать api",

dist/swagger-ui.js

Lines changed: 51 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -429,14 +429,30 @@ this["Handlebars"]["templates"]["operation"] = Handlebars.template({"1":function
429429
if (stack1 != null) { buffer += stack1; }
430430
return buffer + "</div>";
431431
},"19":function(depth0,helpers,partials,data) {
432+
var stack1, buffer = " <h4 data-sw-translate>Headers</h4>\n <table class=\"headers\">\n <thead>\n <tr>\n <th style=\"width: 100px; max-width: 100px\" data-sw-translate>Header</th>\n <th style=\"width: 310px; max-width: 310px\" data-sw-translate>Description</th>\n <th style=\"width: 200px; max-width: 200px\" data-sw-translate>Type</th>\n <th style=\"width: 320px; max-width: 320px\" data-sw-translate>Other</th>\n </tr>\n </thead>\n <tbody>\n";
433+
stack1 = helpers.each.call(depth0, (depth0 != null ? depth0.headers : depth0), {"name":"each","hash":{},"fn":this.program(20, data),"inverse":this.noop,"data":data});
434+
if (stack1 != null) { buffer += stack1; }
435+
return buffer + " </tbody>\n </table>\n";
436+
},"20":function(depth0,helpers,partials,data) {
437+
var lambda=this.lambda, escapeExpression=this.escapeExpression;
438+
return " <tr>\n <td>"
439+
+ escapeExpression(lambda((data && data.key), depth0))
440+
+ "</td>\n <td>"
441+
+ escapeExpression(lambda((depth0 != null ? depth0.description : depth0), depth0))
442+
+ "</td>\n <td>"
443+
+ escapeExpression(lambda((depth0 != null ? depth0.type : depth0), depth0))
444+
+ "</td>\n <td>"
445+
+ escapeExpression(lambda((depth0 != null ? depth0.other : depth0), depth0))
446+
+ "</td>\n </tr>\n";
447+
},"22":function(depth0,helpers,partials,data) {
432448
return " <h4 data-sw-translate>Parameters</h4>\n <table class='fullwidth'>\n <thead>\n <tr>\n <th style=\"width: 100px; max-width: 100px\" data-sw-translate>Parameter</th>\n <th style=\"width: 310px; max-width: 310px\" data-sw-translate>Value</th>\n <th style=\"width: 200px; max-width: 200px\" data-sw-translate>Description</th>\n <th style=\"width: 100px; max-width: 100px\" data-sw-translate>Parameter Type</th>\n <th style=\"width: 220px; max-width: 230px\" data-sw-translate>Data Type</th>\n </tr>\n </thead>\n <tbody class=\"operation-params\">\n\n </tbody>\n </table>\n";
433-
},"21":function(depth0,helpers,partials,data) {
449+
},"24":function(depth0,helpers,partials,data) {
434450
return " <div style='margin:0;padding:0;display:inline'></div>\n <h4 data-sw-translate>Response Messages</h4>\n <table class='fullwidth'>\n <thead>\n <tr>\n <th data-sw-translate>HTTP Status Code</th>\n <th data-sw-translate>Reason</th>\n <th data-sw-translate>Response Model</th>\n <th data-sw-translate>Headers</th>\n </tr>\n </thead>\n <tbody class=\"operation-status\">\n </tbody>\n </table>\n";
435-
},"23":function(depth0,helpers,partials,data) {
451+
},"26":function(depth0,helpers,partials,data) {
436452
return "";
437-
},"25":function(depth0,helpers,partials,data) {
453+
},"28":function(depth0,helpers,partials,data) {
438454
return " <div class='sandbox_header'>\n <input class='submit' type='submit' value='Try it out!' data-sw-translate/>\n <a href='#' class='response_hider' style='display:none' data-sw-translate>Hide Response</a>\n <span class='response_throbber' style='display:none'></span>\n </div>\n";
439-
},"27":function(depth0,helpers,partials,data) {
455+
},"30":function(depth0,helpers,partials,data) {
440456
return " <h4 data-sw-translate>Request Headers</h4>\n <div class='block request_headers'></div>\n";
441457
},"compiler":[6,">= 2.0.0-beta.1"],"main":function(depth0,helpers,partials,data) {
442458
var stack1, helper, options, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression, blockHelperMissing=helpers.blockHelperMissing, buffer = "\n <ul class='operations' >\n <li class='"
@@ -492,15 +508,18 @@ this["Handlebars"]["templates"]["operation"] = Handlebars.template({"1":function
492508
if (stack1 != null) { buffer += stack1; }
493509
stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0.type : depth0), {"name":"if","hash":{},"fn":this.program(16, data),"inverse":this.noop,"data":data});
494510
if (stack1 != null) { buffer += stack1; }
495-
buffer += " <form accept-charset='UTF-8' class='sandbox'>\n <div style='margin:0;padding:0;display:inline'></div>\n";
496-
stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0.parameters : depth0), {"name":"if","hash":{},"fn":this.program(19, data),"inverse":this.noop,"data":data});
511+
buffer += "\n";
512+
stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0.headers : depth0), {"name":"if","hash":{},"fn":this.program(19, data),"inverse":this.noop,"data":data});
513+
if (stack1 != null) { buffer += stack1; }
514+
buffer += "\n <form accept-charset='UTF-8' class='sandbox'>\n <div style='margin:0;padding:0;display:inline'></div>\n";
515+
stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0.parameters : depth0), {"name":"if","hash":{},"fn":this.program(22, data),"inverse":this.noop,"data":data});
497516
if (stack1 != null) { buffer += stack1; }
498-
stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0.responseMessages : depth0), {"name":"if","hash":{},"fn":this.program(21, data),"inverse":this.noop,"data":data});
517+
stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0.responseMessages : depth0), {"name":"if","hash":{},"fn":this.program(24, data),"inverse":this.noop,"data":data});
499518
if (stack1 != null) { buffer += stack1; }
500-
stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0.isReadOnly : depth0), {"name":"if","hash":{},"fn":this.program(23, data),"inverse":this.program(25, data),"data":data});
519+
stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0.isReadOnly : depth0), {"name":"if","hash":{},"fn":this.program(26, data),"inverse":this.program(28, data),"data":data});
501520
if (stack1 != null) { buffer += stack1; }
502521
buffer += " </form>\n <div class='response' style='display:none'>\n <h4 class='curl'>Curl</h4>\n <div class='block curl'></div>\n <h4 data-sw-translate>Request URL</h4>\n <div class='block request_url'></div>\n";
503-
stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0.showRequestHeaders : depth0), {"name":"if","hash":{},"fn":this.program(27, data),"inverse":this.noop,"data":data});
522+
stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0.showRequestHeaders : depth0), {"name":"if","hash":{},"fn":this.program(30, data),"inverse":this.noop,"data":data});
504523
if (stack1 != null) { buffer += stack1; }
505524
return buffer + " <h4 data-sw-translate>Response Body</h4>\n <div class='block response_body'></div>\n <h4 data-sw-translate>Response Code</h4>\n <div class='block response_code'></div>\n <h4 data-sw-translate>Response Headers</h4>\n <div class='block response_headers'></div>\n </div>\n </div>\n </li>\n </ul>\n";
506525
},"useData":true});
@@ -25344,7 +25363,8 @@ SwaggerUi.Views.OperationView = Backbone.View.extend({
2534425363
this.model.responseMessages.push({
2534525364
code: code,
2534625365
message: value.description,
25347-
responseModel: schema
25366+
responseModel: schema,
25367+
headers: value.headers
2534825368
});
2534925369
}
2535025370
}
@@ -25359,6 +25379,7 @@ SwaggerUi.Views.OperationView = Backbone.View.extend({
2535925379
this.model.successCode = key;
2536025380
if (typeof value === 'object' && typeof value.createJSONSample === 'function') {
2536125381
this.model.successDescription = value.description;
25382+
this.model.headers = this.parseResponseHeaders(value.headers);
2536225383
signatureModel = {
2536325384
sampleJSON: JSON.stringify(value.createJSONSample(), void 0, 2),
2536425385
isParam: false,
@@ -25431,6 +25452,26 @@ SwaggerUi.Views.OperationView = Backbone.View.extend({
2543125452
return this;
2543225453
},
2543325454

25455+
parseResponseHeaders: function (data) {
25456+
var HEADERS_SEPARATOR = '; ';
25457+
var headers = _.clone(data);
25458+
25459+
_.forEach(headers, function (header) {
25460+
var other = [];
25461+
_.forEach(header, function (value, key) {
25462+
var properties = ['type', 'description'];
25463+
if (properties.indexOf(key.toLowerCase()) === -1) {
25464+
other.push(key + ': ' + value);
25465+
}
25466+
});
25467+
25468+
other.join(HEADERS_SEPARATOR);
25469+
header.other = other;
25470+
});
25471+
25472+
return headers;
25473+
},
25474+
2543425475
addParameter: function(param, consumes) {
2543525476
// Render a parameter
2543625477
param.consumes = consumes;

dist/swagger-ui.min.js

Lines changed: 11 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/main/javascript/view/OperationView.js

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,8 @@ SwaggerUi.Views.OperationView = Backbone.View.extend({
154154
this.model.responseMessages.push({
155155
code: code,
156156
message: value.description,
157-
responseModel: schema
157+
responseModel: schema,
158+
headers: value.headers
158159
});
159160
}
160161
}
@@ -169,6 +170,7 @@ SwaggerUi.Views.OperationView = Backbone.View.extend({
169170
this.model.successCode = key;
170171
if (typeof value === 'object' && typeof value.createJSONSample === 'function') {
171172
this.model.successDescription = value.description;
173+
this.model.headers = this.parseResponseHeaders(value.headers);
172174
signatureModel = {
173175
sampleJSON: JSON.stringify(value.createJSONSample(), void 0, 2),
174176
isParam: false,
@@ -241,6 +243,26 @@ SwaggerUi.Views.OperationView = Backbone.View.extend({
241243
return this;
242244
},
243245

246+
parseResponseHeaders: function (data) {
247+
var HEADERS_SEPARATOR = '; ';
248+
var headers = _.clone(data);
249+
250+
_.forEach(headers, function (header) {
251+
var other = [];
252+
_.forEach(header, function (value, key) {
253+
var properties = ['type', 'description'];
254+
if (properties.indexOf(key.toLowerCase()) === -1) {
255+
other.push(key + ': ' + value);
256+
}
257+
});
258+
259+
other.join(HEADERS_SEPARATOR);
260+
header.other = other;
261+
});
262+
263+
return headers;
264+
},
265+
244266
addParameter: function(param, consumes) {
245267
// Render a parameter
246268
param.consumes = consumes;

src/main/template/operation.handlebars

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,31 @@
4848
<div class="response-content-type" />
4949

5050
{{/if}}
51+
52+
{{#if headers}}
53+
<h4 data-sw-translate>Headers</h4>
54+
<table class="headers">
55+
<thead>
56+
<tr>
57+
<th style="width: 100px; max-width: 100px" data-sw-translate>Header</th>
58+
<th style="width: 310px; max-width: 310px" data-sw-translate>Description</th>
59+
<th style="width: 200px; max-width: 200px" data-sw-translate>Type</th>
60+
<th style="width: 320px; max-width: 320px" data-sw-translate>Other</th>
61+
</tr>
62+
</thead>
63+
<tbody>
64+
{{#each headers}}
65+
<tr>
66+
<td>{{@key}}</td>
67+
<td>{{this.description}}</td>
68+
<td>{{this.type}}</td>
69+
<td>{{this.other}}</td>
70+
</tr>
71+
{{/each}}
72+
</tbody>
73+
</table>
74+
{{/if}}
75+
5176
<form accept-charset='UTF-8' class='sandbox'>
5277
<div style='margin:0;padding:0;display:inline'></div>
5378
{{#if parameters}}

0 commit comments

Comments
 (0)