-
-
Notifications
You must be signed in to change notification settings - Fork 272
/
petstoreFromFileSpec.ts
44 lines (39 loc) 路 1.04 KB
/
petstoreFromFileSpec.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
/*
* Generated by orval v2.2.2 馃嵑
* Do not edit manually.
* Swagger Petstore
* OpenAPI spec version: 1.0.0
*/
import { AxiosInstance, AxiosPromise } from 'axios';
export interface Pet {
id: number;
name: string;
tag?: string;
}
export type Pets = Pet[];
export interface Error {
code: number;
message: string;
}
export type listPetsParams = { limit?: number };
export interface SwaggerPetstore {
// List all pets
listPets(params?: listPetsParams): AxiosPromise<Pets>;
// Create a pet
createPets(): AxiosPromise<unknown>;
// Info for a specific pet
showPetById(petId: string, testId: string): AxiosPromise<Pet>;
}
export const getSwaggerPetstore = (axios: AxiosInstance): SwaggerPetstore => ({
listPets(params?: listPetsParams): AxiosPromise<Pets> {
return axios.get(`/pets`, {
params,
});
},
createPets(): AxiosPromise<unknown> {
return axios.post(`/pets`, undefined);
},
showPetById(petId: string, testId: string): AxiosPromise<Pet> {
return axios.get(`/pets/${petId}/test/${testId}`);
},
});