Skip to content

Commit

Permalink
fix: fetch not method
Browse files Browse the repository at this point in the history
  • Loading branch information
Mr.Mao committed Aug 9, 2024
1 parent a40a595 commit ec60663
Show file tree
Hide file tree
Showing 8 changed files with 33 additions and 3 deletions.
6 changes: 6 additions & 0 deletions packages/@swag/fetch-js/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# @genapi/swag-fetch-js

## 1.1.5

### Patch Changes

- c

## 1.1.4

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/@swag/fetch-js/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@genapi/swag-fetch-js",
"version": "1.1.4",
"version": "1.1.5",
"main": "src/index.ts",
"scripts": {
"build": "ptsup -r src --dts --meta --clean",
Expand Down
5 changes: 5 additions & 0 deletions packages/@swag/fetch-js/src/parser/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,11 @@ export function transformPaths(paths: Paths, { configRead, functions, interfaces
required: false,
})


if (config.method.toLowerCase() !== 'get') {
options.unshift(['method', `"${config.method}"`])
}

transformHeaderOptions('body', { options, parameters })

options.push(['...', 'config'])
Expand Down
6 changes: 6 additions & 0 deletions packages/@swag/fetch-ts/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# @genapi/swag-fetch-ts

## 1.1.5

### Patch Changes

- c

## 1.1.4

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/@swag/fetch-ts/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@genapi/swag-fetch-ts",
"version": "1.1.4",
"version": "1.1.5",
"main": "src/index.ts",
"scripts": {
"build": "ptsup -r src --dts --meta --clean",
Expand Down
5 changes: 5 additions & 0 deletions packages/@swag/fetch-ts/src/parser/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,13 @@ export function transformPaths(paths: Paths, { configRead, functions, interfaces
required: false,
})

if (config.method.toLowerCase() !== 'get') {
options.unshift(['method', `"${config.method}"`])
}

transformHeaderOptions('body', { options, parameters })


options.push(['...', 'config'])

const { spaceResponseType } = transformParameters(parameters, {
Expand Down
8 changes: 8 additions & 0 deletions packages/@tests/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# @genapi/tests

## 0.1.5

### Patch Changes

- Updated dependencies
- @genapi/swag-fetch-js@1.1.5
- @genapi/swag-fetch-ts@1.1.5

## 0.1.4

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/@tests/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@genapi/tests",
"version": "0.1.4",
"version": "0.1.5",
"private": true,
"dependencies": {
"@genapi/cli": "workspace:*",
Expand Down

0 comments on commit ec60663

Please sign in to comment.