OpenAPITools / OpenAPITools/openapi-generator

[REQ] Support TypeScript Server generation

Open
#4,183 11 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Enhancement: Feature Enhancement: New generator Hacktoberfest help wanted Server: TypeScript
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.

I want to make a server generator of Node using typescript with koa.js.
There is a very nice useful class AbstructTypeScriptClientCodegen for clients, but not for servers.

Describe the solution you'd like

  1. Rename AbstructTypeScriptClientCodegen to AbstructTypeScriptCodegen, and remove getTag() from this
  2. Create AbstructTypeScriptClientCodegen again, add getTag() to this.
  3. Create AbstructTypeScriptServerCodegen, add getTag() to this.

Provably this is a minimal impact and maintainable solution because there are some client generators.
(And we need to change TypeScriptNodeClientCodegen to extends AbstractTypeScriptServerCodegen from AbstractTypeScriptClientCodegen maybe.)

Describe alternatives you've considered

Have only AbstractTypeScriptCodegen
  • Need to add getTag() to all typescript client generators.
  • If increase method for typescript client, we need to change all typescript client generators.
Copy AbstractTypeScriptServerCodegen from AbstructTypeScriptClientCodegen.
  • Almost all functions will overlap with those of client.
    • There are many codes that dependencies TypeScript. It's pretty hard to maintain both codes, I think.
Create AbstractTypeScriptServerCodegen that extends AbstructTypeScriptClientCodegen.
  • if new medhod added to AbstractTypeScriptClientCodegen, it may occur probrem in server.
    • But difficult to notice those problems when working because the name is misleading.

Additional context

TypeScript is used by clients and servers. But other Languages also can have servers and clients.
I would be happy to discuss the good balance of abstraction in this nice project.

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 reading AbstractTypeScriptClientCodegen and TypeScriptNodeClientCodegen, then trace their inheritance and getTag() behavior. The issue is done when the shared TypeScript codegen abstraction supports both client and server generators without breaking existing clients, and a TypeScript Node/Koa server generator can use it.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, nodejs, typescript
Domain
backend, tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.