OpenAPITools / OpenAPITools/openapi-generator
[BUG][typescript-fetch] runtime ConfigurationParameters accessToken doesn't match return type
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 26.8k
- Forks
- 7.7k
- PR merge metrics
- PR metrics pending
Description
Bug Report Checklist
- Have you provided a full/minimal spec to reproduce the issue?
- Have you validated the input using an OpenAPI validator (example)?
- What's the version of OpenAPI Generator used?
- Have you search for related issues/PRs?
- What's the actual output vs expected output?
- [Optional] Bounty to sponsor the fix (example)
Description
In runtime.ts, ConfigurationParameter defines accessToken?: string | ((name?: string, scopes?: string[]) => string); // parameter for oauth2 security, however, the class defines this as get accessToken(): ((name: string, scopes?: string[]) => string) | undefined. Notice the function type makes the first parameter nameoptional for ConfigurationParameter and not on the function return value?
Which is the correct version to use? I can put in a PR accordingly.
openapi-generator version
4.1.2
cc @macjohnny
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in runtime.ts and compare the ConfigurationParameter accessToken declaration with the class getter signature, focusing on whether the name parameter is optional. Confirm the intended function type, make both declarations consistent, and verify the TypeScript client runtime still type-checks.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- openapi, typescript
- Domain
- api, tooling
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100