File tree Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -2125,7 +2125,7 @@ module.exports = {
2125
2125
previewLanguage = this . resolveResponsePreviewLanguageAndResponseHeader ( responseBodyWrapper ,
2126
2126
responseHeaders , response ) ;
2127
2127
// replace 'X' char with '0'
2128
- code = code . replace ( / X / g, '0' ) ;
2128
+ code = code . replace ( / X | x / g, '0' ) ;
2129
2129
code = code === 'default' ? 500 : _ . toSafeInteger ( code ) ;
2130
2130
2131
2131
sdkResponse = new sdk . Response ( {
@@ -2140,6 +2140,13 @@ module.exports = {
2140
2140
return sdkResponse ;
2141
2141
} ,
2142
2142
2143
+ /**
2144
+ * Identifies the previewLanguage to use and also adds the identified content header to the responseHeaders array
2145
+ * @param {object } responseBodyWrapper generated response body and its related information
2146
+ * @param {object } responseHeaders - The existent array of response headers
2147
+ * @param {object } response in operationItem responses
2148
+ * @returns {string } previewLanguage
2149
+ */
2143
2150
resolveResponsePreviewLanguageAndResponseHeader : function ( responseBodyWrapper ,
2144
2151
responseHeaders , response ) {
2145
2152
let previewLanguage = 'text' ;
Original file line number Diff line number Diff line change @@ -76,6 +76,9 @@ describe('Convert method', function() {
76
76
expect ( error ) . to . be . null ;
77
77
expect ( result . output [ 0 ] . data . item [ 0 ] . response [ 0 ] . _postman_previewlanguage ) . to . equal ( 'json' ) ;
78
78
expect ( result . output [ 0 ] . data . item [ 0 ] . response [ 0 ] . body ) . to . not . be . empty ;
79
+ expect ( result . output [ 0 ] . data . item [ 0 ] . response [ 0 ] . header . find ( ( header ) => {
80
+ return header . key === 'Content-Type' ;
81
+ } ) . value ) . to . equal ( '*/*' ) ;
79
82
} ) ;
80
83
done ( ) ;
81
84
} ) ;
You can’t perform that action at this time.
0 commit comments