swagger-api / swagger-api/swagger-codegen

[Typescript-Fetch] Support for default params

Open
#3,641 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Client: TypeScript Enhancement: Feature help wanted
Dominant language
Mustache
Stars
17.8k
Forks
6k
PR merge metrics
No merged PRs in 30d

Description

Description

Typescript-Fetch does not currently generate any code to help with default parameters in methods, but Typescript and ES6 have support for default parameters.

Implementing default parameters can help improve the usability of generated specs.

Swagger-codegen version

2.2.1

Swagger declaration file content or url
Command line used for generation
Steps to reproduce
Related issues
Suggest a Fix

It appears that the defaultValue helper exists to help solve this problem.

{{#defaultValue}}[default to {{defaultValue}}]{{/defaultValue}}

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 with the Typescript-Fetch generator templates and inspect how the mentioned defaultValue helper is currently used. Update the generation path so generated method parameters support TypeScript/ES6 default values, then verify the generated output includes the expected default-parameter behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
tooling
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.