OpenAPITools / OpenAPITools/openapi-generator
[BUG] [typescript-axios] generator additional property `withInterfaces` is incompatible with `useSingleRequestParameter`
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
The interfaces generated by enabling useInterfaces in the typescript-axios generator do not respect useSingleRequestParameter so the code will not compile due to mismatching methods on the implementations.
openapi-generator version
openapi-generator-cli-5.0.0-20200625.105436-332.jar
OpenAPI declaration file content or url
Command line used for generation
openapi-generator generate \
-i $(OPENAPI_SPEC_DOC_JSON) \
-g typescript-axios \
-o $(OPENAPI_SPEC_TS_DIR) \
--additional-properties=supportsES6=true,withInterfaces=true,useSingleRequestParameter=true
Steps to reproduce
Run the generator with the above options.
Suggest a fix
I can provide an example, but it might be less effort to just fix it. A cursory glance makes it look like it just needs allParams.0 in the method signatures of the interface conditioned on the useSingleRequestParameter.
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 by running the supplied openapi-generator command with the typescript-axios generator and both withInterfaces=true and useSingleRequestParameter=true. Compare the generated interface method signatures with their implementations; done means the generated TypeScript compiles without mismatches while both options remain enabled.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- api, tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100