OpenAPITools / OpenAPITools/openapi-generator

[REQ][Typescript] Make `TypeScriptClientCodegen` extend from `AbstractTypeScriptClientCodegen `

Open
#10,711 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Enhancement: Feature
Dominant language
Java
Stars
26.8k
Forks
7.7k
PR merge metrics
PR metrics pending

Description

Is your feature request related to a problem? Please describe.

TypeScriptClientCodegen is very similar to AbstractTypeScriptClientCodegen aside from some options specific to the typescript generator such as the http framework to use. Most of the codegen handling code is pretty much the same, however there are some fixes that have been brought to AbstractTypeScriptClientCodegen that are not present in TypeScriptClientCodegen such as #8000 (fixed by #9275).

Describe the solution you'd like

Instead of porting the changes into TypeScriptClientCodegen I suggest we make TypeScriptClientCodegen extend from AbstractTypeScriptClientCodegen, adapting the former where needed. The language is the same so most of the codegen handling can be re-used and further improvements can be done in a single place.

Describe alternatives you've considered

Alternatively, we can port the fixes/enhancements made to AbstractTypeScriptClientCodegen into TypeScriptClientCodegen but I think this will make feature/enhancement parity between the typescript generator and the typescript-* generators diverge over time.

Additional context

I've already prepped a branch with this change. All tests are passing. I've tested with some specs of my own and it seems to be generating properly as well. (https://github.com/tiagoblackcode/openapi-generator/commit/88b63f1bf9f633bc71ac9125f3e8d7d766c8461d).

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 comparing TypeScriptClientCodegen with AbstractTypeScriptClientCodegen and review the prepared branch commit referenced in the issue. Verify that the inheritance change preserves the typescript generator's specific options and generation behavior, then run the project's test suite; done means all tests pass and generated output remains correct.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, typescript
Domain
tooling
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 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.