-
Notifications
You must be signed in to change notification settings - Fork 6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove circular dependency between swagger codegen and swagger codegen generator repos. #8016
Comments
hey @jmini , would like to know what you think about this, or if you have an idea to share. |
About 3: not practicable in my opinion. The With the new solution, how will they get the appropriate jar? (and update it, when you told them to check if their issue was fixed). |
More generally: I think this is a nice analysis. I would like to see the integration tests in this big picture. When you update the generators, you need to update the |
hey @jmini sorry for this late response. About option 3, what i have in mind is creating an According what solution we take i guess same will be related to |
Hi, any progress on removing this circular dependency? i would like to write some custom language packs and be able to package them inside the plugin, generator and cli. |
Ideally, the specific language packs wouldn't be packaged in the generator but downloaded from somewhere like maven central based on group:artifact:version coordinates and bound via interfaces at runtime. That way you have extensibility baked in. The core generator tests should probably not depend on any actual generators but instead on a special reference test generator which checks whether the core is calling all the right methods on the generator interfaces... If you still want a single jar for the 'default' langs in the cli jar then you could package a special fat jar, but do it in a project which depends on both the core and the generators you wish to bundle... just a thought. |
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
. Butcli
andgenerator
modules require dependency toswagger-codegen-generator
in order to work properly. So as a result this is creating a circular dependency between repos.Swagger-codegen version
3.0.0
Related issues/PRs
#6077
Suggest a fix/enhancement
So right now i see three ways to solve this.
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.
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.
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
With this command we're adding the classes to the classpath without the need to add a dependency to
swagger-codegen
modules. The challenge is doing something similar for plugin and generator modules. Also a .sh/.bat files to wrap that call can be useful.The text was updated successfully, but these errors were encountered: