swagger-api / swagger-api/swagger-codegen
[Typescript] Export type for enum literals
Nobody has claimed this yet.
- Dominant language
- Mustache
- Stars
- 17.8k
- Forks
- 6k
- PR merge metrics
- No merged PRs in 30d
Description
Description
With Feature request 7365 swagger-codegen introduced string-literals for enum paramters.
I like this idea, but it would be great to have an exported type for paramters.. instead of this:
public findByState(status: 'OPEN' | 'CLOSED' | 'UNKNOWN')
something like this:
type statusEnum: 'OPEN' | 'CLOSED' | 'UNKNOWN';
public findByState(status: statusEnum)
Related issues/PRs
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 tracing the TypeScript client generator output for enum parameters and compare it with the behavior introduced by related issue 7365. Done means generated enum-literal parameters have a reusable exported type and method signatures use that type consistently; no specific files or tests are named in the issue.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- api, tooling
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100