You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
createRequestFunction() return type is incompatible.
api.ts:3292:13 - error TS2322: Type '(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<unknown, any>>' is not assignable to type '(
axios?: AxiosInstance | undefined, basePath?: string | undefined) => AxiosPromise<User>'.
Call signature return types 'Promise<AxiosResponse<unknown, any>>' and 'AxiosPromise<User>' are incompatible.
The types of 'then' are incompatible between these types.
Type '<TResult1 = AxiosResponse<unknown, any>, TResult2 = never>(onfulfilled?: ((value: AxiosResponse<unknown, any>) => TResult1 | PromiseLike<TResult1>) | null | undefined
, onrejected?: ((reason: any) => TResult2 | PromiseLike<...>) | ... 1 more ... | undefined) => Promise<...>' is not assignable to type '<TResult1 = AxiosResponse<User, any>, TRes
ult2 = never>(onfulfilled?: ((value: AxiosResponse<User, any>) => TResult1 | PromiseLike<TResult1>) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike<...>
) | ... 1 more ... | undefined) => Promise<...>'.
Types of parameters 'onfulfilled' and 'onfulfilled' are incompatible.
Types of parameters 'value' and 'value' are incompatible.
Type 'AxiosResponse<unknown, any>' is not assignable to type 'AxiosResponse<User, any>'.
Type 'unknown' is not assignable to type 'User'.
3292 return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
I generate typescript-axios client like following.
Bug Report Checklist
Description
axios v0.2.3 was released and has Breaking changes.
https://github.com/axios/axios/releases/tag/v0.23.0
Previous v0.22.0 works fine(No type error)
createRequestFunction()
return type is incompatible.I generate typescript-axios client like following.
npx openapi-generator-cli generate -i ./codegen/openapi.yaml -g typescript-axios -o ./src/apis/sample -c ./codegen/config.json"
openapi-generator version
5.2.1
Thank you!
The text was updated successfully, but these errors were encountered: