Browse Source

updated swagger lib

bubble
Tony Tam 10 years ago
parent
commit
0c44f83c26
3 changed files with 29 additions and 7 deletions
  1. +14
    -3
      dist/lib/swagger.js
  2. +14
    -3
      lib/swagger.js
  3. +1
    -1
      package.json

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

@@ -1,5 +1,5 @@
// swagger.js
// version 2.0.38
// version 2.0.39

var __bind = function(fn, me){
return function(){
@@ -15,6 +15,16 @@ log = function(){
}
};

// if you want to apply conditional formatting of parameter values
parameterMacro = function(value) {
return value;
}

// if you want to apply conditional formatting of model property values
modelPropertyMacro = function(value) {
return value;
}

if (!Array.prototype.indexOf) {
Array.prototype.indexOf = function(obj, start) {
for (var i = (start || 0), j = this.length; i < j; i++) {
@@ -88,6 +98,7 @@ var SwaggerApi = function(url, options) {
this.authorizationScheme = null;
this.info = null;
this.useJQuery = false;
this.modelsArray = [];

options = (options||{});
if (url)
@@ -281,7 +292,6 @@ SwaggerApi.prototype.fail = function(message) {

SwaggerApi.prototype.setConsolidatedModels = function() {
var model, modelName, resource, resource_name, _i, _len, _ref, _ref1, _results;
this.modelsArray = [];
this.models = {};
_ref = this.apis;
for (resource_name in _ref) {
@@ -598,7 +608,7 @@ var SwaggerModelProperty = function(name, obj) {
this.isCollection = this.dataType && (this.dataType.toLowerCase() === 'array' || this.dataType.toLowerCase() === 'list' || this.dataType.toLowerCase() === 'set');
this.descr = obj.description;
this.required = obj.required;
this.defaultValue = obj.defaultValue;
this.defaultValue = modelPropertyMacro(obj.defaultValue);
if (obj.items != null) {
if (obj.items.type != null) {
this.refDataType = obj.items.type;
@@ -776,6 +786,7 @@ var SwaggerOperation = function(nickname, path, method, parameters, summary, not
}
}
}
param.defaultValue = parameterMacro(param.defaultValue);
}
this.resource[this.nickname] = function(args, callback, error) {
return _this["do"](args, callback, error);


+ 14
- 3
lib/swagger.js View File

@@ -1,5 +1,5 @@
// swagger.js
// version 2.0.38
// version 2.0.39

var __bind = function(fn, me){
return function(){
@@ -15,6 +15,16 @@ log = function(){
}
};

// if you want to apply conditional formatting of parameter values
parameterMacro = function(value) {
return value;
}

// if you want to apply conditional formatting of model property values
modelPropertyMacro = function(value) {
return value;
}

if (!Array.prototype.indexOf) {
Array.prototype.indexOf = function(obj, start) {
for (var i = (start || 0), j = this.length; i < j; i++) {
@@ -88,6 +98,7 @@ var SwaggerApi = function(url, options) {
this.authorizationScheme = null;
this.info = null;
this.useJQuery = false;
this.modelsArray = [];

options = (options||{});
if (url)
@@ -281,7 +292,6 @@ SwaggerApi.prototype.fail = function(message) {

SwaggerApi.prototype.setConsolidatedModels = function() {
var model, modelName, resource, resource_name, _i, _len, _ref, _ref1, _results;
this.modelsArray = [];
this.models = {};
_ref = this.apis;
for (resource_name in _ref) {
@@ -598,7 +608,7 @@ var SwaggerModelProperty = function(name, obj) {
this.isCollection = this.dataType && (this.dataType.toLowerCase() === 'array' || this.dataType.toLowerCase() === 'list' || this.dataType.toLowerCase() === 'set');
this.descr = obj.description;
this.required = obj.required;
this.defaultValue = obj.defaultValue;
this.defaultValue = modelPropertyMacro(obj.defaultValue);
if (obj.items != null) {
if (obj.items.type != null) {
this.refDataType = obj.items.type;
@@ -776,6 +786,7 @@ var SwaggerOperation = function(nickname, path, method, parameters, summary, not
}
}
}
param.defaultValue = parameterMacro(param.defaultValue);
}
this.resource[this.nickname] = function(args, callback, error) {
return _this["do"](args, callback, error);


+ 1
- 1
package.json View File

@@ -19,7 +19,7 @@
"readmeFilename": "README.md",
"dependencies": {
"coffee-script": "~1.6.3",
"swagger-client": "2.0.36",
"swagger-client": "2.0.39",
"handlebars": "~1.0.10",
"less": "~1.4.2"
}


Loading…
Cancel
Save