Skip to content

Codegen 3.x next steps  #8395

@frantuma

Description

@frantuma

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}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions