mirror of
https://github.com/ferdikoomen/openapi-typescript-codegen.git
synced 2025-12-08 20:16:21 +00:00
- Tested seperation of OpenAPI object, some small fixes
This commit is contained in:
parent
cd24337650
commit
ae33149797
@ -8,7 +8,7 @@ import type { ApiRequestOptions } from './ApiRequestOptions';
|
||||
import type { ApiResult } from './ApiResult';
|
||||
import { CancelablePromise } from './CancelablePromise';
|
||||
import type { OnCancel } from './CancelablePromise';
|
||||
import { OpenAPIConfig } from './OpenAPI';
|
||||
import type { OpenAPIConfig } from './OpenAPI';
|
||||
|
||||
{{>functions/isDefined}}
|
||||
|
||||
|
||||
@ -9,7 +9,7 @@ const sendRequest = async (
|
||||
): Promise<AxiosResponse<any>> => {
|
||||
const source = axios.CancelToken.source();
|
||||
|
||||
const config: AxiosRequestConfig = {
|
||||
const requestConfig: AxiosRequestConfig = {
|
||||
url,
|
||||
headers,
|
||||
data: body || formData,
|
||||
@ -21,7 +21,7 @@ const sendRequest = async (
|
||||
onCancel(() => source.cancel('The user aborted a request.'));
|
||||
|
||||
try {
|
||||
return await axios.request(config);
|
||||
return await axios.request(requestConfig);
|
||||
} catch (error) {
|
||||
const axiosError = error as AxiosError;
|
||||
if (axiosError.response) {
|
||||
|
||||
@ -5,7 +5,7 @@ import type { ApiRequestOptions } from './ApiRequestOptions';
|
||||
import type { ApiResult } from './ApiResult';
|
||||
import { CancelablePromise } from './CancelablePromise';
|
||||
import type { OnCancel } from './CancelablePromise';
|
||||
import { OpenAPIConfig } from './OpenAPI';
|
||||
import type { OpenAPIConfig } from './OpenAPI';
|
||||
|
||||
{{>functions/isDefined}}
|
||||
|
||||
|
||||
@ -9,7 +9,7 @@ import type { ApiRequestOptions } from './ApiRequestOptions';
|
||||
import type { ApiResult } from './ApiResult';
|
||||
import { CancelablePromise } from './CancelablePromise';
|
||||
import type { OnCancel } from './CancelablePromise';
|
||||
import { OpenAPIConfig } from './OpenAPI';
|
||||
import type { OpenAPIConfig } from './OpenAPI';
|
||||
|
||||
{{>functions/isDefined}}
|
||||
|
||||
|
||||
@ -5,7 +5,7 @@ import type { ApiRequestOptions } from './ApiRequestOptions';
|
||||
import type { ApiResult } from './ApiResult';
|
||||
import { CancelablePromise } from './CancelablePromise';
|
||||
import type { OnCancel } from './CancelablePromise';
|
||||
import { OpenAPIConfig } from './OpenAPI';
|
||||
import type { OpenAPIConfig } from './OpenAPI';
|
||||
|
||||
{{>functions/isDefined}}
|
||||
|
||||
|
||||
@ -4,6 +4,7 @@
|
||||
export { ApiError } from './core/ApiError';
|
||||
export { CancelablePromise, CancelError } from './core/CancelablePromise';
|
||||
export { OpenAPI } from './core/OpenAPI';
|
||||
export type { OpenAPIConfig } from './core/OpenAPI';
|
||||
{{/if}}
|
||||
{{#if @root.exportModels}}
|
||||
{{#if models}}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user