@@ -578,6 +578,20 @@ var Operation = function(parent, scheme, operationId, httpMethod, path, args, de
578578 this . description = args . description ;
579579 this . useJQuery = parent . useJQuery ;
580580
581+ if ( typeof this . deprecated === 'string' ) {
582+ switch ( this . deprecated . toLowerCase ( ) ) {
583+ case 'true' : case 'yes' : case '1' : {
584+ this . deprecated = true ;
585+ break ;
586+ }
587+ case 'false' : case 'no' : case '0' : case null : {
588+ this . deprecated = false ;
589+ break ;
590+ }
591+ default : this . deprecated = Boolean ( this . deprecated ) ;
592+ }
593+ }
594+
581595 if ( definitions ) {
582596 // add to global models
583597 var key ;
@@ -810,9 +824,7 @@ Operation.prototype.getHeaderParams = function (args) {
810824 if ( param . in === 'header' ) {
811825 var value = args [ param . name ] ;
812826 if ( Array . isArray ( value ) )
813- value = this . encodePathCollection ( param . collectionFormat , param . name , value ) ;
814- else
815- value = this . encodePathParam ( value ) ;
827+ value = value . toString ( ) ;
816828 headers [ param . name ] = value ;
817829 }
818830 }
@@ -1683,6 +1695,7 @@ var SwaggerResource = function (resourceObj, api) {
16831695 this . description = resourceObj . description ;
16841696 this . authorizations = ( resourceObj . authorizations || { } ) ;
16851697
1698+
16861699 var parts = this . path . split ( '/' ) ;
16871700 this . name = parts [ parts . length - 1 ] . replace ( '.{format}' , '' ) ;
16881701 this . basePath = this . api . basePath ;
@@ -1761,7 +1774,7 @@ SwaggerResource.prototype.addApiDeclaration = function (response) {
17611774 this . consumes = response . consumes ;
17621775 if ( ( typeof response . basePath === 'string' ) && response . basePath . replace ( / \s / g, '' ) . length > 0 )
17631776 this . basePath = response . basePath . indexOf ( 'http' ) === - 1 ? this . getAbsoluteBasePath ( response . basePath ) : response . basePath ;
1764-
1777+ this . resourcePath = response . resourcePath ;
17651778 this . addModels ( response . models ) ;
17661779 if ( response . apis ) {
17671780 for ( var i = 0 ; i < response . apis . length ; i ++ ) {
@@ -2040,9 +2053,23 @@ var SwaggerOperation = function (nickname, path, method, parameters, summary, no
20402053 this . consumes = consumes ;
20412054 this . produces = produces ;
20422055 this . authorizations = typeof authorizations !== 'undefined' ? authorizations : resource . authorizations ;
2043- this . deprecated = ( typeof deprecated === 'string' ? Boolean ( deprecated ) : deprecated ) ;
2056+ this . deprecated = deprecated ;
20442057 this [ 'do' ] = __bind ( this [ 'do' ] , this ) ;
20452058
2059+ if ( typeof this . deprecated === 'string' ) {
2060+ switch ( this . deprecated . toLowerCase ( ) ) {
2061+ case 'true' : case 'yes' : case '1' : {
2062+ this . deprecated = true ;
2063+ break ;
2064+ }
2065+ case 'false' : case 'no' : case '0' : case null : {
2066+ this . deprecated = false ;
2067+ break ;
2068+ }
2069+ default : this . deprecated = Boolean ( this . deprecated ) ;
2070+ }
2071+ }
2072+
20462073 if ( errors . length > 0 ) {
20472074 console . error ( 'SwaggerOperation errors' , errors , arguments ) ;
20482075 this . resource . api . fail ( errors ) ;
0 commit comments