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
[Optional] Sponsorship to speed up the bug fix or feature request (example)
Description
The typescript-fetch client fails to compile.
Compilation failure:
src/ext/runtime.ts:152:9 - error TS2322: Type '((input: RequestInfo, init?: RequestInit | undefined) => Promise<Response>) | undefined' is not assignable to type '(input: RequestInfo, init?: RequestInit | undefined) => Promise<Response>'.
Type 'undefined' is not assignable to type '(input: RequestInfo, init?: RequestInit | undefined) => Promise<Response>'.
152 return this.configuration.fetchApi;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
openapi-generator version
Version: v5.2.1
Regression: Yes
Generation Details
CLI used:
docker run -v "${PWD}:/local" openapitools/openapi-generator-cli:v5.2.1 generate -i /local/<specfile> -g typescript-fetch
Bug Report Checklist
Description
The
typescript-fetch
client fails to compile.Compilation failure:
openapi-generator version
Version: v5.2.1
Regression: Yes
Generation Details
CLI used:
Steps to reproduce
See above
Related issues/PRs
This was introduced in: c05ec99
This causes an error because this config value may be
undefined
:https://github.com/OpenAPITools/openapi-generator/blob/master/modules/openapi-generator/src/main/resources/typescript-fetch/runtime.mustache#L122
Suggest a fix
The fallback as seen here: https://github.com/OpenAPITools/openapi-generator/blob/master/modules/openapi-generator/src/main/resources/typescript-fetch/runtime.mustache#L122
Could be added to the getter.
The text was updated successfully, but these errors were encountered: