@@ -12,7 +12,7 @@ const arrayOrEmpty = (ar) => {
1212 return Array . isArray ( ar ) ? ar : [ ]
1313}
1414
15- const OperationNotFoundError = createError ( 'OperationNotFoundError' , function ( message , extra , oriError ) {
15+ const OperationNotFoundError = createError ( 'OperationNotFoundError' , function ( message , extra , oriError ) {
1616 this . originalError = oriError
1717 Object . assign ( this , extra || { } )
1818} )
@@ -117,7 +117,7 @@ export function buildRequest({
117117 const builder = parameterBuilders [ parameter . in ]
118118 let value
119119
120- if ( parameter . in === 'body' && parameter . schema && parameter . schema . properties ) {
120+ if ( parameter . in === 'body' && parameter . schema && parameter . schema . properties ) {
121121 value = parameters
122122 }
123123
@@ -142,14 +142,18 @@ export function buildRequest({
142142 if ( req . body || req . form ) {
143143 if ( requestContentType ) {
144144 req . headers [ 'content-type' ] = requestContentType
145- } else if ( Array . isArray ( operation . consumes ) ) {
145+ }
146+ else if ( Array . isArray ( operation . consumes ) ) {
146147 req . headers [ 'content-type' ] = operation . consumes [ 0 ]
147- } else if ( Array . isArray ( spec . consumes ) ) {
148+ }
149+ else if ( Array . isArray ( spec . consumes ) ) {
148150 req . headers [ 'content-type' ] = spec . consumes [ 0 ]
149- } else if ( operation . parameters . filter ( ( p ) => p . type === "file" ) . length ) {
150- req . headers [ 'content-type' ] = "multipart/form-data"
151- } else if ( operation . parameters . filter ( ( p ) => p . in === "formData" ) . length ) {
152- req . headers [ 'content-type' ] = "application/x-www-form-urlencoded"
151+ }
152+ else if ( operation . parameters . filter ( p => p . type === 'file' ) . length ) {
153+ req . headers [ 'content-type' ] = 'multipart/form-data'
154+ }
155+ else if ( operation . parameters . filter ( p => p . in === 'formData' ) . length ) {
156+ req . headers [ 'content-type' ] = 'application/x-www-form-urlencoded'
153157 }
154158 }
155159
0 commit comments