diff --git a/packages/@swag/fetch-js/src/parser/index.ts b/packages/@swag/fetch-js/src/parser/index.ts index f8147a3..6037d11 100644 --- a/packages/@swag/fetch-js/src/parser/index.ts +++ b/packages/@swag/fetch-js/src/parser/index.ts @@ -69,10 +69,8 @@ export function transformPaths(paths: Paths, { configRead, functions, interfaces required: false, }) - - if (config.method.toLowerCase() !== 'get') { + if (config.method.toLowerCase() !== 'get') options.unshift(['method', `"${config.method}"`]) - } transformHeaderOptions('body', { options, parameters }) diff --git a/packages/@swag/fetch-ts/src/parser/index.ts b/packages/@swag/fetch-ts/src/parser/index.ts index 882dbc0..2830fc1 100644 --- a/packages/@swag/fetch-ts/src/parser/index.ts +++ b/packages/@swag/fetch-ts/src/parser/index.ts @@ -64,13 +64,11 @@ export function transformPaths(paths: Paths, { configRead, functions, interfaces required: false, }) - if (config.method.toLowerCase() !== 'get') { + if (config.method.toLowerCase() !== 'get') options.unshift(['method', `"${config.method}"`]) - } transformHeaderOptions('body', { options, parameters }) - options.push(['...', 'config']) const { spaceResponseType } = transformParameters(parameters, {