swagger-api / swagger-api/swagger-codegen

Codegen 3.x next steps

Open
#8,395 0 comments 4 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

The goal of this ticket is to define a proposal for development direction of swagger-codegen 3.0 line, to support the following high level functionalities:

  1. supports both 2.x and 3.x spec
  2. supports both 2.x and 3.x languages/templates
  3. each language module develop able/testable independently
  4. Easier language module development

The proposal is to define a set of milestones, addressing identified requirements in subsequent steps, as detailed below. This would allow a progressive enhancement of provided functionality, maintaining an "affordable pace" in its development.

We ask the community for feedback or any comments, alternative ideas, proposals, requests for clarifications etc, in order to have a common understanding and agreement about what we want to achieve, why and how.


M1 - Support both 2 and 3 spec with related templates
  • change groupId and package of 3.0, as done for core and parser
  • add/update codegen module entry point as wrapper for calls to 2.x and 3.x codegen module
  • refactor and adapt swagger-generator and swagger-codgencli module 3 module to call both 2.x and 3.x codegen via the new entry point
  • allow option to parse 2.x as 2.x or as converted 3.x spec with related templates
  • update generator spec + controller to support direct download of generated files (on top of current 2-steps download)

M2 - Support 2.x mustache templates for 3.0 spec (and vice versa)
  • proof of concept
  • converter 2->3 and 3->2 for intermediate model and options
  • refactor / adapt engine to support "converted languages"

M3 - each language module testable independently and with independent lifecycle, supporting versioning
  • move api + spi (codegenConfig, intermediate model etc) to own repo (2 separate modules)
  • move cli, maven plugin and generator to own repo
  • rename/slightly refactor spi to be more meaningful
  • adapt codegen + generators modules
  • each language module in own repo
  • fix/simplify CI
  • uses provided test module/infrastructure

Codegen ecosystem would therefore be divided into the following repositories (temporary naming):

  • swagger-codegen (core/engine)
  • swagger-codegen-api (api + spi)
  • swagger-codegen-generator (generator rest service)
  • swagger-codegen-cli (CLI)
  • swagger-codegen-maven (maven plugin)
  • swagger-codegen-module-java
  • swagger-codegen-module-js
  • swagger-codegen-module-{language}

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 reviewing the existing swagger-codegen core, generator, CLI, and Maven modules against the M1–M3 milestones described here. Trace how the 2.x and 3.x codegen modules, templates, language modules, and test infrastructure are currently organized. Done means producing a community-reviewed proposal with agreed milestones and repository boundaries.

Written by the indexing model from the issue text.

Assessment

Domain
cli, devtools, tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.