swagger-api / swagger-api/swagger-codegen
Typescript-node - Should use the `async` keyword on methods returning a promise
Nobody has claimed this yet.
- Dominant language
- Mustache
- Stars
- 17.8k
- Forks
- 6k
- PR merge metrics
- No merged PRs in 30d
Description
I installed swagger-codegen@2 on a mac to make sure that typescript-node was included as a language. When generating a Typescript-node API there is no need to include bluebird as a dependency. Also the async methods that return a promise should be defined with the async keyword. For example:
public methodName(): Promise<type>
should be
public async methodName(): Promise<type>
Description
Swagger-codegen version
V2.4.1
Command line used for generation
swagger-codegen generate -i swagger.json -l typescript-node
Steps to reproduce
Any typescript-node generation
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 from the typescript-node generation entry point used by swagger-codegen generate -i swagger.json -l typescript-node, then inspect the templates and dependency declarations that produce the generated API. Generate a sample API to verify that bluebird is no longer required and that promise-returning methods use async.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- node.js, typescript
- Domain
- api
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100