-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Support response body for DELETE requests (#38)
- Loading branch information
Showing
4 changed files
with
87 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
src/test/snapshots/4-delete-by-id-number-with-response.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
{ | ||
"basePath": "/", | ||
"info": { | ||
"description": "", | ||
"title": "", | ||
"version": "" | ||
}, | ||
"paths": { | ||
"/api/v1/exchange/{id}": { | ||
"delete": { | ||
"consumes": [ | ||
"application/json" | ||
], | ||
"parameters": [ | ||
{ | ||
"in": "path", | ||
"name": "id", | ||
"required": true, | ||
"type": "number" | ||
} | ||
], | ||
"produces": [ | ||
"application/json" | ||
], | ||
"responses": { | ||
"200": { | ||
"description": "", | ||
"schema": { | ||
"type": "number" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"schemes": [ | ||
"http" | ||
], | ||
"swagger": "2.0", | ||
"tags": [] | ||
} |
22 changes: 22 additions & 0 deletions
22
src/test/snapshots/4-delete-by-id-number-with-response.ts.fixture
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
/* tslint:disable */ | ||
|
||
/** | ||
* This file was automatically generated by "Swaxios". | ||
* It should not be modified by hand. | ||
*/ | ||
|
||
import {AxiosInstance} from 'axios'; | ||
|
||
export class ExchangeService { | ||
private readonly apiClient: AxiosInstance; | ||
|
||
constructor(apiClient: AxiosInstance) { | ||
this.apiClient = apiClient; | ||
} | ||
|
||
async deleteById(id: number): Promise<number> { | ||
const resource = `/api/v1/exchange/${id}`; | ||
const response = await this.apiClient.delete<number>(resource); | ||
return response.data; | ||
} | ||
} |