Merge branch 'bodnia-master'

This commit is contained in:
Tony Tam
2015-12-31 11:18:07 -08:00
6 changed files with 170 additions and 26 deletions

53
dist/lang/pl.js vendored Normal file
View File

@@ -0,0 +1,53 @@
'use strict';
/* jshint quotmark: double */
window.SwaggerTranslator.learn({
"Warning: Deprecated":"Uwaga: Wycofane",
"Implementation Notes":"Uwagi Implementacji",
"Response Class":"Klasa Odpowiedzi",
"Status":"Status",
"Parameters":"Parametry",
"Parameter":"Parametr",
"Value":"Wartość",
"Description":"Opis",
"Parameter Type":"Typ Parametru",
"Data Type":"Typ Danych",
"Response Messages":"Wiadomości Odpowiedzi",
"HTTP Status Code":"Kod Statusu HTTP",
"Reason":"Przyczyna",
"Response Model":"Model Odpowiedzi",
"Request URL":"URL Wywołania",
"Response Body":"Treść Odpowiedzi",
"Response Code":"Kod Odpowiedzi",
"Response Headers":"Nagłówki Odpowiedzi",
"Hide Response":"Ukryj Odpowiedź",
"Headers":"Nagłówki",
"Try it out!":"Wypróbuj!",
"Show/Hide":"Pokaż/Ukryj",
"List Operations":"Lista Operacji",
"Expand Operations":"Rozwiń Operacje",
"Raw":"Nieprzetworzone",
"can't parse JSON. Raw result":"nie można przetworzyć pliku JSON. Nieprzetworzone dane",
"Model Schema":"Schemat Modelu",
"Model":"Model",
"apply":"użyj",
"Username":"Nazwa użytkownika",
"Password":"Hasło",
"Terms of service":"Warunki używania",
"Created by":"Utworzone przez",
"See more at":"Zobacz więcej na",
"Contact the developer":"Kontakt z deweloperem",
"api version":"wersja api",
"Response Content Type":"Typ Zasobu Odpowiedzi",
"fetching resource":"ładowanie zasobu",
"fetching resource list":"ładowanie listy zasobów",
"Explore":"Eksploruj",
"Show Swagger Petstore Example Apis":"Pokaż Przykładowe Api Swagger Petstore",
"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.",
"Please specify the protocol for":"Proszę podać protokół dla",
"Can't read swagger JSON from":"Nie można odczytać swagger JSON z",
"Finished Loading Resource Information. Rendering Swagger UI":"Ukończono Ładowanie Informacji o Zasobie. Renderowanie Swagger UI",
"Unable to read api":"Nie można odczytać api",
"from path":"ze ścieżki",
"server returned":"serwer zwrócił"
});

11
dist/lang/ru.js vendored
View File

@@ -2,7 +2,7 @@
/* jshint quotmark: double */ /* jshint quotmark: double */
window.SwaggerTranslator.learn({ window.SwaggerTranslator.learn({
"Warning: Deprecated":"Ворнинг: Депрекейтед", "Warning: Deprecated":"Предупреждение: Устарело",
"Implementation Notes":"Заметки", "Implementation Notes":"Заметки",
"Response Class":"Пример ответа", "Response Class":"Пример ответа",
"Status":"Статус", "Status":"Статус",
@@ -20,6 +20,7 @@ window.SwaggerTranslator.learn({
"Response Code":"HTTP код ответа", "Response Code":"HTTP код ответа",
"Response Headers":"Заголовки ответа", "Response Headers":"Заголовки ответа",
"Hide Response":"Спрятать ответ", "Hide Response":"Спрятать ответ",
"Headers":"Заголовки",
"Response Messages":"Что может прийти в ответ", "Response Messages":"Что может прийти в ответ",
"Try it out!":"Попробовать!", "Try it out!":"Попробовать!",
"Show/Hide":"Показать/Скрыть", "Show/Hide":"Показать/Скрыть",
@@ -29,6 +30,7 @@ window.SwaggerTranslator.learn({
"can't parse JSON. Raw result":"Не удается распарсить ответ:", "can't parse JSON. Raw result":"Не удается распарсить ответ:",
"Model Schema":"Структура", "Model Schema":"Структура",
"Model":"Описание", "Model":"Описание",
"Click to set as parameter value":"Нажмите, чтобы испльзовать в качестве значения параметра",
"apply":"применить", "apply":"применить",
"Username":"Имя пользователя", "Username":"Имя пользователя",
"Password":"Пароль", "Password":"Пароль",
@@ -38,12 +40,13 @@ window.SwaggerTranslator.learn({
"Contact the developer":"Связаться с разработчиком", "Contact the developer":"Связаться с разработчиком",
"api version":"Версия API", "api version":"Версия API",
"Response Content Type":"Content Type ответа", "Response Content Type":"Content Type ответа",
"Parameter content type:":"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":"Не получается прочитать swagger json из", "Can't read swagger JSON from":"Не получается прочитать swagger json из",
"Finished Loading Resource Information. Rendering Swagger UI":"Загрузка информации о ресурсах завершена. Рендерим", "Finished Loading Resource Information. Rendering Swagger UI":"Загрузка информации о ресурсах завершена. Рендерим",
"Unable to read api":"Не удалось прочитать api", "Unable to read api":"Не удалось прочитать api",

61
dist/swagger-ui.js vendored
View File

@@ -429,14 +429,30 @@ this["Handlebars"]["templates"]["operation"] = Handlebars.template({"1":function
if (stack1 != null) { buffer += stack1; } if (stack1 != null) { buffer += stack1; }
return buffer + "</div>"; return buffer + "</div>";
},"19":function(depth0,helpers,partials,data) { },"19":function(depth0,helpers,partials,data) {
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";
stack1 = helpers.each.call(depth0, (depth0 != null ? depth0.headers : depth0), {"name":"each","hash":{},"fn":this.program(20, data),"inverse":this.noop,"data":data});
if (stack1 != null) { buffer += stack1; }
return buffer + " </tbody>\n </table>\n";
},"20":function(depth0,helpers,partials,data) {
var lambda=this.lambda, escapeExpression=this.escapeExpression;
return " <tr>\n <td>"
+ escapeExpression(lambda((data && data.key), depth0))
+ "</td>\n <td>"
+ escapeExpression(lambda((depth0 != null ? depth0.description : depth0), depth0))
+ "</td>\n <td>"
+ escapeExpression(lambda((depth0 != null ? depth0.type : depth0), depth0))
+ "</td>\n <td>"
+ escapeExpression(lambda((depth0 != null ? depth0.other : depth0), depth0))
+ "</td>\n </tr>\n";
},"22":function(depth0,helpers,partials,data) {
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"; 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";
},"21":function(depth0,helpers,partials,data) { },"24":function(depth0,helpers,partials,data) {
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"; 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";
},"23":function(depth0,helpers,partials,data) { },"26":function(depth0,helpers,partials,data) {
return ""; return "";
},"25":function(depth0,helpers,partials,data) { },"28":function(depth0,helpers,partials,data) {
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"; 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";
},"27":function(depth0,helpers,partials,data) { },"30":function(depth0,helpers,partials,data) {
return " <h4 data-sw-translate>Request Headers</h4>\n <div class='block request_headers'></div>\n"; return " <h4 data-sw-translate>Request Headers</h4>\n <div class='block request_headers'></div>\n";
},"compiler":[6,">= 2.0.0-beta.1"],"main":function(depth0,helpers,partials,data) { },"compiler":[6,">= 2.0.0-beta.1"],"main":function(depth0,helpers,partials,data) {
var stack1, helper, options, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression, blockHelperMissing=helpers.blockHelperMissing, buffer = "\n <ul class='operations' >\n <li class='" 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
if (stack1 != null) { buffer += stack1; } if (stack1 != null) { buffer += stack1; }
stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0.type : depth0), {"name":"if","hash":{},"fn":this.program(16, data),"inverse":this.noop,"data":data}); stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0.type : depth0), {"name":"if","hash":{},"fn":this.program(16, data),"inverse":this.noop,"data":data});
if (stack1 != null) { buffer += stack1; } if (stack1 != null) { buffer += stack1; }
buffer += " <form accept-charset='UTF-8' class='sandbox'>\n <div style='margin:0;padding:0;display:inline'></div>\n"; buffer += "\n";
stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0.parameters : depth0), {"name":"if","hash":{},"fn":this.program(19, data),"inverse":this.noop,"data":data}); stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0.headers : depth0), {"name":"if","hash":{},"fn":this.program(19, data),"inverse":this.noop,"data":data});
if (stack1 != null) { buffer += stack1; } if (stack1 != null) { buffer += stack1; }
stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0.responseMessages : depth0), {"name":"if","hash":{},"fn":this.program(21, data),"inverse":this.noop,"data":data}); buffer += "\n <form accept-charset='UTF-8' class='sandbox'>\n <div style='margin:0;padding:0;display:inline'></div>\n";
stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0.parameters : depth0), {"name":"if","hash":{},"fn":this.program(22, data),"inverse":this.noop,"data":data});
if (stack1 != null) { buffer += stack1; } if (stack1 != null) { buffer += stack1; }
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}); stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0.responseMessages : depth0), {"name":"if","hash":{},"fn":this.program(24, data),"inverse":this.noop,"data":data});
if (stack1 != null) { buffer += stack1; }
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});
if (stack1 != null) { buffer += stack1; } if (stack1 != null) { buffer += stack1; }
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"; 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";
stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0.showRequestHeaders : depth0), {"name":"if","hash":{},"fn":this.program(27, data),"inverse":this.noop,"data":data}); stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0.showRequestHeaders : depth0), {"name":"if","hash":{},"fn":this.program(30, data),"inverse":this.noop,"data":data});
if (stack1 != null) { buffer += stack1; } if (stack1 != null) { buffer += stack1; }
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"; 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";
},"useData":true}); },"useData":true});
@@ -25344,7 +25363,8 @@ SwaggerUi.Views.OperationView = Backbone.View.extend({
this.model.responseMessages.push({ this.model.responseMessages.push({
code: code, code: code,
message: value.description, message: value.description,
responseModel: schema responseModel: schema,
headers: value.headers
}); });
} }
} }
@@ -25359,6 +25379,7 @@ SwaggerUi.Views.OperationView = Backbone.View.extend({
this.model.successCode = key; this.model.successCode = key;
if (typeof value === 'object' && typeof value.createJSONSample === 'function') { if (typeof value === 'object' && typeof value.createJSONSample === 'function') {
this.model.successDescription = value.description; this.model.successDescription = value.description;
this.model.headers = this.parseResponseHeaders(value.headers);
signatureModel = { signatureModel = {
sampleJSON: JSON.stringify(value.createJSONSample(), void 0, 2), sampleJSON: JSON.stringify(value.createJSONSample(), void 0, 2),
isParam: false, isParam: false,
@@ -25431,6 +25452,26 @@ SwaggerUi.Views.OperationView = Backbone.View.extend({
return this; return this;
}, },
parseResponseHeaders: function (data) {
var HEADERS_SEPARATOR = '; ';
var headers = _.clone(data);
_.forEach(headers, function (header) {
var other = [];
_.forEach(header, function (value, key) {
var properties = ['type', 'description'];
if (properties.indexOf(key.toLowerCase()) === -1) {
other.push(key + ': ' + value);
}
});
other.join(HEADERS_SEPARATOR);
header.other = other;
});
return headers;
},
addParameter: function(param, consumes) { addParameter: function(param, consumes) {
// Render a parameter // Render a parameter
param.consumes = consumes; param.consumes = consumes;

File diff suppressed because one or more lines are too long

View File

@@ -154,7 +154,8 @@ SwaggerUi.Views.OperationView = Backbone.View.extend({
this.model.responseMessages.push({ this.model.responseMessages.push({
code: code, code: code,
message: value.description, message: value.description,
responseModel: schema responseModel: schema,
headers: value.headers
}); });
} }
} }
@@ -169,6 +170,7 @@ SwaggerUi.Views.OperationView = Backbone.View.extend({
this.model.successCode = key; this.model.successCode = key;
if (typeof value === 'object' && typeof value.createJSONSample === 'function') { if (typeof value === 'object' && typeof value.createJSONSample === 'function') {
this.model.successDescription = value.description; this.model.successDescription = value.description;
this.model.headers = this.parseResponseHeaders(value.headers);
signatureModel = { signatureModel = {
sampleJSON: JSON.stringify(value.createJSONSample(), void 0, 2), sampleJSON: JSON.stringify(value.createJSONSample(), void 0, 2),
isParam: false, isParam: false,
@@ -241,6 +243,26 @@ SwaggerUi.Views.OperationView = Backbone.View.extend({
return this; return this;
}, },
parseResponseHeaders: function (data) {
var HEADERS_SEPARATOR = '; ';
var headers = _.clone(data);
_.forEach(headers, function (header) {
var other = [];
_.forEach(header, function (value, key) {
var properties = ['type', 'description'];
if (properties.indexOf(key.toLowerCase()) === -1) {
other.push(key + ': ' + value);
}
});
other.join(HEADERS_SEPARATOR);
header.other = other;
});
return headers;
},
addParameter: function(param, consumes) { addParameter: function(param, consumes) {
// Render a parameter // Render a parameter
param.consumes = consumes; param.consumes = consumes;

View File

@@ -48,6 +48,31 @@
<div class="response-content-type" /> <div class="response-content-type" />
{{/if}} {{/if}}
{{#if headers}}
<h4 data-sw-translate>Headers</h4>
<table class="headers">
<thead>
<tr>
<th style="width: 100px; max-width: 100px" data-sw-translate>Header</th>
<th style="width: 310px; max-width: 310px" data-sw-translate>Description</th>
<th style="width: 200px; max-width: 200px" data-sw-translate>Type</th>
<th style="width: 320px; max-width: 320px" data-sw-translate>Other</th>
</tr>
</thead>
<tbody>
{{#each headers}}
<tr>
<td>{{@key}}</td>
<td>{{this.description}}</td>
<td>{{this.type}}</td>
<td>{{this.other}}</td>
</tr>
{{/each}}
</tbody>
</table>
{{/if}}
<form accept-charset='UTF-8' class='sandbox'> <form accept-charset='UTF-8' class='sandbox'>
<div style='margin:0;padding:0;display:inline'></div> <div style='margin:0;padding:0;display:inline'></div>
{{#if parameters}} {{#if parameters}}