Merge remote-tracking branch 'swagger-api/master'

This commit is contained in:
Anna Bodnia
2016-01-22 11:37:27 +02:00
3 changed files with 48 additions and 2 deletions

23
dist/swagger-ui.js vendored
View File

@@ -25543,6 +25543,9 @@ SwaggerUi.Views.OperationView = Backbone.View.extend({
statusCode = ref5[q]; statusCode = ref5[q];
statusCode.isXML = isXML; statusCode.isXML = isXML;
statusCode.isJSON = isJSON; statusCode.isJSON = isJSON;
if (!_.isUndefined(statusCode.headers)) {
statusCode.headers = this.parseHeadersType(statusCode.headers);
}
this.addStatusCode(statusCode); this.addStatusCode(statusCode);
} }
@@ -25550,6 +25553,26 @@ SwaggerUi.Views.OperationView = Backbone.View.extend({
return this; return this;
}, },
parseHeadersType: function (headers) {
var map = {
'string': {
'date-time': 'dateTime',
'date' : 'date'
}
};
_.forEach(headers, function (header) {
var value;
header = header || {};
value = map[header.type] && map[header.type][header.format];
if (!_.isUndefined(value)) {
header.type = value;
}
});
return headers;
},
contains: function (produces, type) { contains: function (produces, type) {
return produces.filter(function (val) { return produces.filter(function (val) {
if (val.indexOf(type) > -1) { if (val.indexOf(type) > -1) {

File diff suppressed because one or more lines are too long

View File

@@ -246,6 +246,9 @@ SwaggerUi.Views.OperationView = Backbone.View.extend({
statusCode = ref5[q]; statusCode = ref5[q];
statusCode.isXML = isXML; statusCode.isXML = isXML;
statusCode.isJSON = isJSON; statusCode.isJSON = isJSON;
if (!_.isUndefined(statusCode.headers)) {
statusCode.headers = this.parseHeadersType(statusCode.headers);
}
this.addStatusCode(statusCode); this.addStatusCode(statusCode);
} }
@@ -253,6 +256,26 @@ SwaggerUi.Views.OperationView = Backbone.View.extend({
return this; return this;
}, },
parseHeadersType: function (headers) {
var map = {
'string': {
'date-time': 'dateTime',
'date' : 'date'
}
};
_.forEach(headers, function (header) {
var value;
header = header || {};
value = map[header.type] && map[header.type][header.format];
if (!_.isUndefined(value)) {
header.type = value;
}
});
return headers;
},
contains: function (produces, type) { contains: function (produces, type) {
return produces.filter(function (val) { return produces.filter(function (val) {
if (val.indexOf(type) > -1) { if (val.indexOf(type) > -1) {