Skip to content

Commit f81530a

Browse files
Initial exploration and understanding of version issue
Co-authored-by: jasonblanchard <1238532+jasonblanchard@users.noreply.github.com>
1 parent 319e236 commit f81530a

File tree

1 file changed

+219
-0
lines changed

1 file changed

+219
-0
lines changed
Lines changed: 219 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,219 @@
1+
/**
2+
* This file was auto-generated by openapi-typescript-server@unknown.
3+
* Do not make direct changes to the file.
4+
*/
5+
6+
import type { paths } from ";
7+
import type { Route } from "openapi-typescript-server-runtime";
8+
import { NotImplementedError } from "openapi-typescript-server-runtime";
9+
10+
export interface ListPetsArgs<Req, Res> {
11+
parameters: paths['/pets']['get']['parameters'];
12+
contentType: string;
13+
req: Req;
14+
res: Res;
15+
}
16+
17+
interface ListPetsResult200 {
18+
content: { 200: paths['/pets']['get']['responses']['200']['content'] };
19+
headers?: { [name: string]: any };
20+
}
21+
22+
interface ListPetsResultDefault {
23+
content: { default: paths['/pets']['get']['responses']['default']['content'] };
24+
headers?: { [name: string]: any };
25+
status: number;
26+
}
27+
28+
export type ListPetsResult = Promise<ListPetsResult200 | ListPetsResultDefault>;
29+
30+
export async function listPetsUnimplemented(): ListPetsResult {
31+
throw new NotImplementedError()
32+
}
33+
34+
export interface GetPetByIdArgs<Req, Res> {
35+
parameters: paths['/pet/{petId}']['get']['parameters'];
36+
contentType: string;
37+
req: Req;
38+
res: Res;
39+
}
40+
41+
interface GetPetByIdResult200 {
42+
content: { 200: paths['/pet/{petId}']['get']['responses']['200']['content'] };
43+
headers?: { [name: string]: any };
44+
}
45+
46+
interface GetPetByIdResultDefault {
47+
content: { default: paths['/pet/{petId}']['get']['responses']['default']['content'] };
48+
headers?: { [name: string]: any };
49+
status: number;
50+
}
51+
52+
export type GetPetByIdResult = Promise<GetPetByIdResult200 | GetPetByIdResultDefault>;
53+
54+
export async function getPetByIdUnimplemented(): GetPetByIdResult {
55+
throw new NotImplementedError()
56+
}
57+
58+
export interface UpdatePetWithFormArgs<Req, Res> {
59+
parameters: paths['/pet/{petId}']['post']['parameters'];
60+
contentType: string;
61+
req: Req;
62+
res: Res;
63+
requestBody: {
64+
mediaType: "application/json";
65+
content: paths['/pet/{petId}']['post']['requestBody']['content']['application/json']
66+
}
67+
| {
68+
mediaType: "application/xml";
69+
content: paths['/pet/{petId}']['post']['requestBody']['content']['application/xml']
70+
}
71+
| {
72+
mediaType: "application/x-www-form-urlencoded";
73+
content: paths['/pet/{petId}']['post']['requestBody']['content']['application/x-www-form-urlencoded']
74+
}
75+
;
76+
}
77+
78+
interface UpdatePetWithFormResult200 {
79+
content: { 200: paths['/pet/{petId}']['post']['responses']['200']['content'] };
80+
headers?: { [name: string]: any };
81+
}
82+
83+
interface UpdatePetWithFormResultDefault {
84+
content: { default: paths['/pet/{petId}']['post']['responses']['default']['content'] };
85+
headers?: { [name: string]: any };
86+
status: number;
87+
}
88+
89+
export type UpdatePetWithFormResult = Promise<UpdatePetWithFormResult200 | UpdatePetWithFormResultDefault>;
90+
91+
export async function updatePetWithFormUnimplemented(): UpdatePetWithFormResult {
92+
throw new NotImplementedError()
93+
}
94+
95+
export interface MixedContentTypesArgs<Req, Res> {
96+
parameters: paths['/pet/{petId}/mixed-content-types']['post']['parameters'];
97+
contentType: string;
98+
req: Req;
99+
res: Res;
100+
requestBody: {
101+
mediaType: "application/json";
102+
content: paths['/pet/{petId}/mixed-content-types']['post']['requestBody']['content']['application/json']
103+
}
104+
| {
105+
mediaType: "application/xml";
106+
content: paths['/pet/{petId}/mixed-content-types']['post']['requestBody']['content']['application/xml']
107+
}
108+
;
109+
}
110+
111+
interface MixedContentTypesResult200 {
112+
content: { 200: paths['/pet/{petId}/mixed-content-types']['post']['responses']['200']['content'] };
113+
headers?: { [name: string]: any };
114+
}
115+
116+
interface MixedContentTypesResultDefault {
117+
content: { default: paths['/pet/{petId}/mixed-content-types']['post']['responses']['default']['content'] };
118+
headers?: { [name: string]: any };
119+
status: number;
120+
}
121+
122+
export type MixedContentTypesResult = Promise<MixedContentTypesResult200 | MixedContentTypesResultDefault>;
123+
124+
export async function mixedContentTypesUnimplemented(): MixedContentTypesResult {
125+
throw new NotImplementedError()
126+
}
127+
128+
export interface GetPetImageArgs<Req, Res> {
129+
parameters: paths['/pet/{petId}/image']['get']['parameters'];
130+
contentType: string;
131+
req: Req;
132+
res: Res;
133+
}
134+
135+
interface GetPetImageResult200 {
136+
content: { 200: paths['/pet/{petId}/image']['get']['responses']['200']['content'] };
137+
headers?: { [name: string]: any };
138+
}
139+
140+
export type GetPetImageResult = Promise<GetPetImageResult200>;
141+
142+
export async function getPetImageUnimplemented(): GetPetImageResult {
143+
throw new NotImplementedError()
144+
}
145+
146+
export interface GetPetWebpageArgs<Req, Res> {
147+
parameters: paths['/pet/{petId}/webpage']['get']['parameters'];
148+
contentType: string;
149+
req: Req;
150+
res: Res;
151+
}
152+
153+
interface GetPetWebpageResult200 {
154+
content: { 200: paths['/pet/{petId}/webpage']['get']['responses']['200']['content'] };
155+
headers?: { [name: string]: any };
156+
}
157+
158+
export type GetPetWebpageResult = Promise<GetPetWebpageResult200>;
159+
160+
export async function getPetWebpageUnimplemented(): GetPetWebpageResult {
161+
throw new NotImplementedError()
162+
}
163+
164+
export interface Server<Req = unknown, Res = unknown> {
165+
/** Returns all pets from the system that the user has access to */
166+
listPets: (
167+
args: ListPetsArgs<Req, Res>
168+
) => ListPetsResult;
169+
getPetById: (
170+
args: GetPetByIdArgs<Req, Res>
171+
) => GetPetByIdResult;
172+
updatePetWithForm: (
173+
args: UpdatePetWithFormArgs<Req, Res>
174+
) => UpdatePetWithFormResult;
175+
mixedContentTypes: (
176+
args: MixedContentTypesArgs<Req, Res>
177+
) => MixedContentTypesResult;
178+
getPetImage: (
179+
args: GetPetImageArgs<Req, Res>
180+
) => GetPetImageResult;
181+
getPetWebpage: (
182+
args: GetPetWebpageArgs<Req, Res>
183+
) => GetPetWebpageResult;
184+
}
185+
186+
export function registerRouteHandlers<Req, Res>(server: Server<Req, Res>): Route[] {
187+
return [
188+
{
189+
method: "get",
190+
path: "/pets",
191+
handler: server.listPets as Route["handler"],
192+
},
193+
{
194+
method: "get",
195+
path: "/pet/{petId}",
196+
handler: server.getPetById as Route["handler"],
197+
},
198+
{
199+
method: "post",
200+
path: "/pet/{petId}",
201+
handler: server.updatePetWithForm as Route["handler"],
202+
},
203+
{
204+
method: "post",
205+
path: "/pet/{petId}/mixed-content-types",
206+
handler: server.mixedContentTypes as Route["handler"],
207+
},
208+
{
209+
method: "get",
210+
path: "/pet/{petId}/image",
211+
handler: server.getPetImage as Route["handler"],
212+
},
213+
{
214+
method: "get",
215+
path: "/pet/{petId}/webpage",
216+
handler: server.getPetWebpage as Route["handler"],
217+
},
218+
]
219+
}

0 commit comments

Comments
 (0)