swagger-api / swagger-api/swagger-codegen

[Typescript] Export type for enum literals

Open
#8,435 0 comments 2 reactions 0 assignees View on GitHub

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

https://github.com/swagger-api/swagger-codegen/issues/7365

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.