Skip to content

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

@HugoMario

Description

@HugoMario
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.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions