OpenAPITools / OpenAPITools/openapi-generator

this.configuration.fetchApi might be null

Open
#10,604 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
26.8k
Forks
7.7k
PR merge metrics
PR metrics pending

Description

https://github.com/OpenAPITools/openapi-generator/blob/ee9687f38c1d2ff696dd87e53a1105df349eb1fc/modules/openapi-generator/src/main/resources/typescript-fetch/runtime.mustache#L141

Had to replace this line with the following to make my tsc obey my will:

    return this.configuration.fetchApi != null ? this.configuration.fetchApi : fetch;

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The affected template is modules/openapi-generator/src/main/resources/typescript-fetch/runtime.mustache around line 141. Start by generating a TypeScript Fetch client and running tsc with the reported configuration; done means the generated code accepts a nullable configuration.fetchApi without manual edits.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
api
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.