Selaa lähdekoodia

updated to support 1.2 spec responseMessages

bubble
Tony Tam 11 vuotta sitten
vanhempi
commit
d133e38f21
2 muutettua tiedostoa jossa 14 lisäystä ja 4 poistoa
  1. +12
    -2
      dist/lib/swagger.js
  2. +2
    -2
      package.json

+ 12
- 2
dist/lib/swagger.js Näytä tiedosto

@@ -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));
}


+ 2
- 2
package.json Näytä tiedosto

@@ -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"
}
}

Ladataan…
Peruuta
Tallenna