diff --git a/dist/lib/swagger.js b/dist/lib/swagger.js index c6f0cd37..fc40c5d8 100644 --- a/dist/lib/swagger.js +++ b/dist/lib/swagger.js @@ -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)); } diff --git a/package.json b/package.json index 37bfd378..7abfd93d 100644 --- a/package.json +++ b/package.json @@ -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" } }