Related #32
Using the same the petstore swagger.json, the generated TypeScript includes the following code:
loginUser(__params: UserApi.LoginUserRequest, options?: RequestInit): (fetch?: FetchAPI, basePath?: string) => Promise<UserApi.LoginUserResponse> {
const localVarFetchArgs = UserApiFetchParamCreator(configuration).loginUser(__params, options);
return async (fetch: FetchAPI = defaultFetch, basePath: string = BASE_PATH) => {
const response = await fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options)
const contentType = response.headers.get('Content-Type');
const mimeType = contentType ? contentType.replace(/;.*/, '') : undefined;
if (response.status === 200) {
if (mimeType === 'application/json') {
return {
status: 200,
contentType: 'application/json',
body: await response.json() as string,
headers: {
xExpiresAfter: response.headers.get('X-Expires-After'),
xRateLimit: response.headers.get('X-Rate-Limit'),
},
}
}
if (mimeType === 'application/xml') {
return {
status: 200,
contentType: 'application/xml',
body: await response.text(),
headers: {
xExpiresAfter: response.headers.get('X-Expires-After'),
xRateLimit: response.headers.get('X-Rate-Limit'),
},
}
}
throw response;
}
if (response.status === 400) {
return {
status: 400,
/* No content */
}
}
throw response;
};
},
It doesn't compile because of the following error,

Related #32
Using the same the petstore swagger.json, the generated TypeScript includes the following code:
It doesn't compile because of the following error,