swagger-api / swagger-api/swagger-codegen
[typescript-angular] useSingleRequestParameter is ignored
Nobody has claimed this yet.
- Dominant language
- Mustache
- Stars
- 17.8k
- Forks
- 6k
- PR merge metrics
- No merged PRs in 30d
Description
Description
I found the info about the config parameter useSingleRequestParameter in this docs: https://openapi-generator.tech/docs/generators/typescript-angular/
I expect, that I can call the service functions in the generated api with something like:
myService.get_whatever({ mandatory_1: 1, optional_2: 2 })
instead of
myService.get_whatever(1, undefined, 2 })
But the parameter is ignored. No code change no matter if I add it or not.
I compile the api with this code
docker run --rm \
--network="host" \
-v ${PWD}:/local swaggerapi/swagger-codegen-cli generate \
-i http://my-project.test:8000/api/swagger.json \
-l typescript-angular \
-o /local/services/myservice/src/api \
--additional-properties=useSingleRequestParameter=true
Swagger-codegen version
swaggerapi/swagger-codegen-cli:2.4.17
Command line used for generation
docker run --rm \
--network="host" \
-v ${PWD}:/local swaggerapi/swagger-codegen-cli generate \
-i http://my-project.test:8000/api/swagger.json \
-l typescript-angular \
-o /local/services/myservice/src/api \
--additional-properties=useSingleRequestParameter=true
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
Reproduce the issue with the documented typescript-angular generator and the provided Docker command using swaggerapi/swagger-codegen-cli:2.4.17. Inspect the generator and its templates to determine why useSingleRequestParameter does not affect generated service signatures; done means the generated methods accept one parameter object when the option is enabled and retain the existing form otherwise.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- angular, typescript
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100