swagger-api / swagger-api/swagger-codegen

Remove circular dependency between swagger codegen and swagger codegen generator repos.

Open
#8,016 6 comments 0 reactions 1 assignee View on GitHub

@HugoMario is already working on this.

Since Apr 13, 2018.

Dominant language
Mustache
Stars
17.8k
Forks
6k
PR merge metrics
No merged PRs in 30d

Description

Description

for 3.0.0 version, swagger codegen use languages packs (classes and templates) in a different (a new one) repository swagger-codegen-generators.

Based on #6077, language classes from new repo must implement an interface located on swagger-codegen repo CodegenConfig. But cliand generator modules require dependency to swagger-codegen-generator in order to work properly. So as a result this is creating a circular dependency between repos.

swagger-codegenv3

Swagger-codegen version

3.0.0

Related issues/PRs

#6077

Suggest a fix/enhancement

So right now i see three ways to solve this.

  1. This new repo would contains the interface and a few classes related to it. Swagger codegen core module and swagger codegen generator repo would point to this new one.

  2. Move CodegenConfig interface to swagger-codegen-generator repo. Cause that's the key to points to swagger-codegen core module from swagger-codegen-generator repo.

  3. Remove swagger-codegen-generator dependency from cli and generator modules. None class for swagger-codegen-generator repo is used in any of the swagger-codegen modules, the dependency is used in order to add generator classes in classpath.
    So, changing the way the CLI command is used it could be a way to solve this. i.e

java -cp [generator jar file location]:target/swagger-codegen-cli.jar [Main class here] generate -i [definition] -l java -o [folder]

With this command we're adding the classes to the classpath without the need to add a dependency to swagger-codegenmodules. The challenge is doing something similar for plugin and generator modules. Also a .sh/.bat files to wrap that call can be useful.

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.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.