-
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.
feat: Parse required attributes for body and query parameters (#48)
- Loading branch information
Showing
6 changed files
with
96 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
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
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,48 @@ | ||
{ | ||
"info": { | ||
"description": "User API", | ||
"title": "", | ||
"version": "" | ||
}, | ||
"paths": { | ||
"/api/user": { | ||
"get": { | ||
"consumes": [ | ||
"application/json" | ||
], | ||
"parameters": [ | ||
{ | ||
"in": "query", | ||
"name": "firstname", | ||
"required": true, | ||
"type": "string" | ||
}, | ||
{ | ||
"in": "query", | ||
"name": "lastname", | ||
"required": true, | ||
"type": "string" | ||
}, | ||
{ | ||
"in": "query", | ||
"name": "age", | ||
"required": false, | ||
"type": "number" | ||
} | ||
], | ||
"produces": [ | ||
"application/json" | ||
], | ||
"responses": { | ||
"200": { | ||
"description": "", | ||
"schema": { | ||
"type": "string" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"swagger": "2.0" | ||
} |
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,29 @@ | ||
/* tslint:disable */ | ||
|
||
/** | ||
* This file was automatically generated by "Swaxios". | ||
* It should not be modified by hand. | ||
*/ | ||
|
||
import {AxiosInstance} from 'axios'; | ||
|
||
export class UserService { | ||
private readonly apiClient: AxiosInstance; | ||
|
||
constructor(apiClient: AxiosInstance) { | ||
this.apiClient = apiClient; | ||
} | ||
|
||
async getAll(params?: { | ||
firstname: string; | ||
lastname: string; | ||
age?: number; | ||
}): Promise<string> { | ||
const resource = '/api/user'; | ||
const config = { | ||
params, | ||
}; | ||
const response = await this.apiClient.get<string>(resource, config); | ||
return response.data; | ||
} | ||
} |