updated to support 1.2 spec responseMessages
This commit is contained in:
14
dist/lib/swagger.js
vendored
14
dist/lib/swagger.js
vendored
@@ -260,7 +260,7 @@
|
||||
};
|
||||
|
||||
SwaggerResource.prototype.addOperations = function(resource_path, ops) {
|
||||
var consumes, o, op, _i, _len, _results;
|
||||
var consumes, err, errorResponses, o, op, _i, _j, _len, _len1, _results;
|
||||
if (ops) {
|
||||
_results = [];
|
||||
for (_i = 0, _len = ops.length; _i < _len; _i++) {
|
||||
@@ -269,7 +269,17 @@
|
||||
if (o.supportedContentTypes) {
|
||||
consumes = o.supportedContentTypes;
|
||||
}
|
||||
op = new SwaggerOperation(o.nickname, resource_path, o.httpMethod, o.parameters, o.summary, o.notes, o.responseClass, o.errorResponses, this, o.consumes, o.produces);
|
||||
errorResponses = o.responseMessages;
|
||||
if (errorResponses) {
|
||||
for (_j = 0, _len1 = errorResponses.length; _j < _len1; _j++) {
|
||||
err = errorResponses[_j];
|
||||
err.reason = err.message;
|
||||
}
|
||||
}
|
||||
if (o.errorResponses) {
|
||||
errorResponses = o.errorResponses;
|
||||
}
|
||||
op = new SwaggerOperation(o.nickname, resource_path, o.httpMethod, o.parameters, o.summary, o.notes, o.responseClass, errorResponses, this, o.consumes, o.produces);
|
||||
this.operations[op.nickname] = op;
|
||||
_results.push(this.operationsArray.push(op));
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "swagger-ui",
|
||||
"version": "0.1.14",
|
||||
"version": "0.1.15",
|
||||
"description": "Swagger UI is a dependency-free collection of HTML, Javascript, and CSS assets that dynamically generate beautiful documentation from a Swagger-compliant API",
|
||||
"scripts": {
|
||||
"build": "PATH=$PATH:./node_modules/.bin cake dist",
|
||||
@@ -19,7 +19,7 @@
|
||||
"readmeFilename": "README.md",
|
||||
"dependencies": {
|
||||
"coffee-script": "~1.5.0",
|
||||
"swagger-client": "1.0.3",
|
||||
"swagger-client": "1.0.4",
|
||||
"handlebars": "~1.0.10"
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user