Browse Source

updated swagger-client

bubble
Tony Tam 10 years ago
parent
commit
0c0ffc569f
3 changed files with 52 additions and 8 deletions
  1. +25
    -3
      dist/lib/swagger.js
  2. +25
    -3
      lib/swagger.js
  3. +2
    -2
      package.json

+ 25
- 3
dist/lib/swagger.js View File

@@ -1,9 +1,15 @@
// Generated by CoffeeScript 1.6.3
(function() {
var ApiKeyAuthorization, PasswordAuthorization, SwaggerApi, SwaggerAuthorizations, SwaggerHttp, SwaggerModel, SwaggerModelProperty, SwaggerOperation, SwaggerRequest, SwaggerResource,
var ApiKeyAuthorization, PasswordAuthorization, SwaggerApi, SwaggerAuthorizations, SwaggerHttp, SwaggerModel, SwaggerModelProperty, SwaggerOperation, SwaggerRequest, SwaggerResource, log,
__bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; },
__indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; };

log = function() {
if (window.console) {
return console.log.apply(console, arguments);
}
};

SwaggerApi = (function() {
SwaggerApi.prototype.url = "http://api.wordnik.com/v4/resources.json";

@@ -596,9 +602,9 @@
result = this.refModel.createJSONSample(modelsToIgnore);
} else {
if (this.isCollection) {
result = this.refDataType;
result = this.toSampleValue(this.refDataType);
} else {
result = this.dataType;
result = this.toSampleValue(this.dataType);
}
}
if (this.isCollection) {
@@ -608,6 +614,22 @@
}
};

SwaggerModelProperty.prototype.toSampleValue = function(value) {
var result;
if (value === "integer") {
result = 0;
} else if (value === "boolean") {
result = false;
} else if (value === "double") {
result = 0.0;
} else if (value === "string") {
result = "";
} else {
result = value;
}
return result;
};

SwaggerModelProperty.prototype.toString = function() {
var req, str;
req = this.required ? 'propReq' : 'propOpt';


+ 25
- 3
lib/swagger.js View File

@@ -1,9 +1,15 @@
// Generated by CoffeeScript 1.6.3
(function() {
var ApiKeyAuthorization, PasswordAuthorization, SwaggerApi, SwaggerAuthorizations, SwaggerHttp, SwaggerModel, SwaggerModelProperty, SwaggerOperation, SwaggerRequest, SwaggerResource,
var ApiKeyAuthorization, PasswordAuthorization, SwaggerApi, SwaggerAuthorizations, SwaggerHttp, SwaggerModel, SwaggerModelProperty, SwaggerOperation, SwaggerRequest, SwaggerResource, log,
__bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; },
__indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; };

log = function() {
if (window.console) {
return console.log.apply(console, arguments);
}
};

SwaggerApi = (function() {
SwaggerApi.prototype.url = "http://api.wordnik.com/v4/resources.json";

@@ -596,9 +602,9 @@
result = this.refModel.createJSONSample(modelsToIgnore);
} else {
if (this.isCollection) {
result = this.refDataType;
result = this.toSampleValue(this.refDataType);
} else {
result = this.dataType;
result = this.toSampleValue(this.dataType);
}
}
if (this.isCollection) {
@@ -608,6 +614,22 @@
}
};

SwaggerModelProperty.prototype.toSampleValue = function(value) {
var result;
if (value === "integer") {
result = 0;
} else if (value === "boolean") {
result = false;
} else if (value === "double") {
result = 0.0;
} else if (value === "string") {
result = "";
} else {
result = value;
}
return result;
};

SwaggerModelProperty.prototype.toString = function() {
var req, str;
req = this.required ? 'propReq' : 'propOpt';


+ 2
- 2
package.json View File

@@ -1,6 +1,6 @@
{
"name": "swagger-ui",
"version": "2.0.5",
"version": "2.0.6",
"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": "2.0.11",
"swagger-client": "2.0.12",
"handlebars": "~1.0.10",
"less": "~1.4.2"
}


Loading…
Cancel
Save