@@ -157,22 +157,27 @@ const getBaseUrl = function (openApi, path, method) {
157157 * @param {Object } values Optional: query parameter values to use in the snippet if present
158158 * @returns {Object } Object describing the parameters in a given OpenAPI method
159159 */
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' ;
162163 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 */
164166 } 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 + '' ;
170175 }
171176 return {
172177 name : param . name ,
173- value : value
174- }
175- }
178+ value : value ,
179+ } ;
180+ } ;
176181
177182/**
178183 * Get array of objects describing the query parameters for a path and method
@@ -214,7 +219,7 @@ const getQueryStrings = function (openApi, path, method, values) {
214219 typeof param . in !== 'undefined' &&
215220 param . in . toLowerCase ( ) === 'query'
216221 ) {
217- queryStrings . push ( getParameterValues ( param , values ) )
222+ queryStrings . push ( getParameterValues ( param , values ) ) ;
218223 }
219224 }
220225 }
@@ -308,7 +313,7 @@ const getHeadersArray = function (openApi, path, method) {
308313 typeof param . in !== 'undefined' &&
309314 param . in . toLowerCase ( ) === 'header'
310315 ) {
311- headers . push ( getParameterValues ( param ) )
316+ headers . push ( getParameterValues ( param ) ) ;
312317 }
313318 }
314319 }
0 commit comments