1
1
// swagger.js
2
- // version 2.0.36
2
+ // version 2.0.37
3
3
4
4
var __bind = function ( fn , me ) {
5
5
return function ( ) {
@@ -45,41 +45,40 @@ if (!('map' in Array.prototype)) {
45
45
}
46
46
47
47
Object . keys = Object . keys || ( function ( ) {
48
- var hasOwnProperty = Object . prototype . hasOwnProperty ,
49
- hasDontEnumBug = ! { toString :null } . propertyIsEnumerable ( "toString" ) ,
50
- DontEnums = [
51
- 'toString' ,
52
- 'toLocaleString' ,
53
- 'valueOf' ,
54
- 'hasOwnProperty' ,
55
- 'isPrototypeOf' ,
56
- 'propertyIsEnumerable' ,
57
- 'constructor'
58
- ] ,
59
- DontEnumsLength = DontEnums . length ;
60
-
61
- return function ( o ) {
62
- if ( typeof o != "object" && typeof o != "function" || o === null )
63
- throw new TypeError ( "Object.keys called on a non-object" ) ;
64
-
65
- var result = [ ] ;
66
- for ( var name in o ) {
67
- if ( hasOwnProperty . call ( o , name ) )
68
- result . push ( name ) ;
69
- }
48
+ var hasOwnProperty = Object . prototype . hasOwnProperty ,
49
+ hasDontEnumBug = ! { toString :null } . propertyIsEnumerable ( "toString" ) ,
50
+ DontEnums = [
51
+ 'toString' ,
52
+ 'toLocaleString' ,
53
+ 'valueOf' ,
54
+ 'hasOwnProperty' ,
55
+ 'isPrototypeOf' ,
56
+ 'propertyIsEnumerable' ,
57
+ 'constructor'
58
+ ] ,
59
+ DontEnumsLength = DontEnums . length ;
60
+
61
+ return function ( o ) {
62
+ if ( typeof o != "object" && typeof o != "function" || o === null )
63
+ throw new TypeError ( "Object.keys called on a non-object" ) ;
64
+
65
+ var result = [ ] ;
66
+ for ( var name in o ) {
67
+ if ( hasOwnProperty . call ( o , name ) )
68
+ result . push ( name ) ;
69
+ }
70
70
71
- if ( hasDontEnumBug ) {
72
- for ( var i = 0 ; i < DontEnumsLength ; i ++ ) {
73
- if ( hasOwnProperty . call ( o , DontEnums [ i ] ) )
74
- result . push ( DontEnums [ i ] ) ;
75
- }
76
- }
71
+ if ( hasDontEnumBug ) {
72
+ for ( var i = 0 ; i < DontEnumsLength ; i ++ ) {
73
+ if ( hasOwnProperty . call ( o , DontEnums [ i ] ) )
74
+ result . push ( DontEnums [ i ] ) ;
75
+ }
76
+ }
77
77
78
- return result ;
79
- } ;
78
+ return result ;
79
+ } ;
80
80
} ) ( ) ;
81
81
82
-
83
82
var SwaggerApi = function ( url , options ) {
84
83
this . url = null ;
85
84
this . debug = false ;
@@ -158,6 +157,7 @@ SwaggerApi.prototype.buildFromSpec = function(response) {
158
157
}
159
158
this . apis = { } ;
160
159
this . apisArray = [ ] ;
160
+ this . consumes = response . consumes ;
161
161
this . produces = response . produces ;
162
162
this . authSchemes = response . authorizations ;
163
163
if ( response . info != null ) {
@@ -175,13 +175,13 @@ SwaggerApi.prototype.buildFromSpec = function(response) {
175
175
}
176
176
}
177
177
}
178
- if ( response . basePath ) {
178
+ if ( response . basePath )
179
179
this . basePath = response . basePath ;
180
- } else if ( this . url . indexOf ( '?' ) > 0 ) {
180
+ else if ( this . url . indexOf ( '?' ) > 0 )
181
181
this . basePath = this . url . substring ( 0 , this . url . lastIndexOf ( '?' ) ) ;
182
- } else {
182
+ else
183
183
this . basePath = this . url ;
184
- }
184
+
185
185
if ( isApi ) {
186
186
var newName = response . resourcePath . replace ( / \/ / g, '' ) ;
187
187
this . resourcePath = response . resourcePath ;
@@ -321,8 +321,8 @@ var SwaggerResource = function(resourceObj, api) {
321
321
var _this = this ;
322
322
this . api = api ;
323
323
this . api = this . api ;
324
- produces = [ ] ;
325
- consumes = [ ] ;
324
+ consumes = ( this . consumes | [ ] ) ;
325
+ produces = ( this . produces | [ ] ) ;
326
326
this . path = this . api . resourcePath != null ? this . api . resourcePath : resourceObj . path ;
327
327
this . description = resourceObj . description ;
328
328
@@ -1191,7 +1191,7 @@ var SwaggerRequest = function(type, url, params, opts, successCallback, errorCal
1191
1191
SwaggerRequest . prototype . setHeaders = function ( params , operation ) {
1192
1192
// default type
1193
1193
var accepts = "application/json" ;
1194
- var contentType = null ;
1194
+ var consumes = "application/json" ;
1195
1195
1196
1196
var allDefinedParams = this . operation . parameters ;
1197
1197
var definedFormParams = [ ] ;
0 commit comments