@@ -157,22 +157,27 @@ const getBaseUrl = function (openApi, path, method) {
157
157
* @param {Object } values Optional: query parameter values to use in the snippet if present
158
158
* @returns {Object } Object describing the parameters in a given OpenAPI method
159
159
*/
160
- const getParameterValues = function ( param , values ) {
161
- let value = 'SOME_' + ( param . type || param . schema . type ) . toUpperCase ( ) + '_VALUE'
160
+ const getParameterValues = function ( param , values ) {
161
+ let value =
162
+ 'SOME_' + ( param . type || param . schema . type ) . toUpperCase ( ) + '_VALUE' ;
162
163
if ( values && typeof values [ param . name ] !== 'undefined' ) {
163
- value = values [ param . name ] + '' /* adding a empty string to convert to string */
164
+ value =
165
+ values [ param . name ] + '' ; /* adding a empty string to convert to string */
164
166
} else if ( typeof param . default !== 'undefined' ) {
165
- value = param . default + ''
166
- } else if ( typeof param . schema !== 'undefined' && typeof param . schema . example !== 'undefined' ) {
167
- value = param . schema . example + ''
168
- } else if ( typeof param . example !== 'undefined' ) {
169
- value = param . example + ''
167
+ value = param . default + '' ;
168
+ } else if (
169
+ typeof param . schema !== 'undefined' &&
170
+ typeof param . schema . example !== 'undefined'
171
+ ) {
172
+ value = param . schema . example + '' ;
173
+ } else if ( typeof param . example !== 'undefined' ) {
174
+ value = param . example + '' ;
170
175
}
171
176
return {
172
177
name : param . name ,
173
- value : value
174
- }
175
- }
178
+ value : value ,
179
+ } ;
180
+ } ;
176
181
177
182
/**
178
183
* Get array of objects describing the query parameters for a path and method
@@ -214,7 +219,7 @@ const getQueryStrings = function (openApi, path, method, values) {
214
219
typeof param . in !== 'undefined' &&
215
220
param . in . toLowerCase ( ) === 'query'
216
221
) {
217
- queryStrings . push ( getParameterValues ( param , values ) )
222
+ queryStrings . push ( getParameterValues ( param , values ) ) ;
218
223
}
219
224
}
220
225
}
@@ -308,7 +313,7 @@ const getHeadersArray = function (openApi, path, method) {
308
313
typeof param . in !== 'undefined' &&
309
314
param . in . toLowerCase ( ) === 'header'
310
315
) {
311
- headers . push ( getParameterValues ( param ) )
316
+ headers . push ( getParameterValues ( param ) ) ;
312
317
}
313
318
}
314
319
}
0 commit comments