openapi-generator
openapi-generator copied to clipboard
[BUG] [typescript-axios] generator additional property `withInterfaces` is incompatible with `useSingleRequestParameter`
Bug Report Checklist
- [ ] Have you provided a full/minimal spec to reproduce the issue?
- [x] Have you validated the input using an OpenAPI validator (example)?
- [x] What's the version of OpenAPI Generator used?
- [x] Have you search for related issues/PRs?
- [x] 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
.
👍 Thanks for opening this issue! 🏷 I have applied any labels matching special text in your issue.
The team will review the labels and make any necessary changes.
Hi,
Are there any updates on this ? As far as I'm aware of this issue is still relevant.
Thanks in advance
I've also run into this: at a glance the angular implementation could likely be stolen with minimal adaptation: https://github.com/OpenAPITools/openapi-generator/blob/0204bf4ae284d936e4f7cb1ffad314c04d5df9db/modules/openapi-generator/src/main/resources/typescript-angular/apiInterface.mustache#L33
An additional issue is that the parameter objects are not used consistently (DefaultApi and DefaultApiFactory drift)
May I ask is there any update on this issue?
Faced this issue as well.