@@ -571,12 +571,17 @@ Operation.prototype.getBody = function (headers, args) {
571571 for ( var i = 0 ; i < this . parameters . length ; i ++ ) {
572572 param = this . parameters [ i ] ;
573573 if ( typeof args [ param . name ] !== 'undefined' ) {
574+ var isPassword ;
575+ if ( param . type === 'string' && param . format === 'password' ) {
576+ isPassword = 'password' ;
577+ }
574578 if ( param . in === 'body' ) {
575579 body = args [ param . name ] ;
576580 } else if ( param . in === 'formData' ) {
577581 formParams [ param . name ] = {
578582 param : param ,
579- value : args [ param . name ]
583+ value : args [ param . name ] ,
584+ password : isPassword
580585 } ;
581586 hasFormParams = true ;
582587 }
@@ -608,20 +613,21 @@ Operation.prototype.getBody = function (headers, args) {
608613 for ( key in formParams ) {
609614 param = formParams [ key ] . param ;
610615 value = formParams [ key ] . value ;
616+ var password = formParams [ key ] . password ;
611617
612618 if ( typeof value !== 'undefined' ) {
613619 if ( Array . isArray ( value ) ) {
614620 if ( encoded !== '' ) {
615621 encoded += '&' ;
616622 }
617- encoded += this . encodeQueryCollection ( param . collectionFormat , key , value ) ;
623+ encoded += this . encodeQueryCollection ( param . collectionFormat , key , value , password ) ;
618624 }
619625 else {
620626 if ( encoded !== '' ) {
621627 encoded += '&' ;
622628 }
623629
624- encoded += encodeURIComponent ( key ) + '=' + encodeURIComponent ( value ) ;
630+ encoded += encodeURIComponent ( key ) + '=' + mask ( encodeURIComponent ( value ) , password ) ;
625631 }
626632 }
627633 }
@@ -1153,7 +1159,7 @@ Operation.prototype.encodePathCollection = function (type, name, value, maskPass
11531159 return encoded ;
11541160} ;
11551161
1156- Operation . prototype . encodeQueryCollection = function ( type , name , value ) {
1162+ Operation . prototype . encodeQueryCollection = function ( type , name , value , maskPasswords ) {
11571163 var encoded = '' ;
11581164 var i ;
11591165
@@ -1162,7 +1168,7 @@ Operation.prototype.encodeQueryCollection = function (type, name, value) {
11621168 for ( i = 0 ; i < value . length ; i ++ ) {
11631169 if ( i > 0 ) { encoded += '&' ; }
11641170
1165- encoded += this . encodeQueryKey ( name ) + '=' + this . encodeQueryParam ( value [ i ] ) ;
1171+ encoded += this . encodeQueryKey ( name ) + '=' + mask ( this . encodeQueryParam ( value [ i ] ) , maskPasswords ) ;
11661172 }
11671173 } else {
11681174 var separator = '' ;
@@ -1180,8 +1186,7 @@ Operation.prototype.encodeQueryCollection = function (type, name, value) {
11801186 if ( i !== 0 ) {
11811187 encoded += '&' ;
11821188 }
1183-
1184- encoded += this . encodeQueryKey ( name ) + '[]=' + this . encodeQueryParam ( value [ i ] ) ;
1189+ encoded += this . encodeQueryKey ( name ) + '[]=' + mask ( this . encodeQueryParam ( value [ i ] ) , maskPasswords ) ;
11851190 }
11861191 }
11871192
0 commit comments