OpenAPITools / OpenAPITools/openapi-generator
Refactor org.openapitools.codegen package
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 26.8k
- Forks
- 7.7k
- PR merge metrics
- PR metrics pending
Description
Hi, @wing328 @spacether
Issue Description
Package org.openapitools.codegen is a promiscuous package, and groups together miscellaneous functionalities that might be useful to different subsystems. The package structure violates the “high cohesion and low coupling” design rules. I found that Class CliOption and SpecValidationException is not used by classes in their package. The project has grown larger, leading to becoming increasingly hard to maintain. For example, if one modifies package org.openapitools.codegen (i.e., package rename), resulting in multiple classes of package org.openapitools.codegen.languages to be changed.
Location: The source file can be found at path File modules/openapi-generator/src/main/java/org/openapitools/codegen/CliOption.java
modules/openapi-generator/src/main/java/org/openapitools/codegen/SpecValidationException.java
Refactoring suggestions
I suggest to move class CliOption into package org.openapitools.codegen.languages, SpecValidationException into package org.openapitools.codegen.config.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with modules/openapi-generator/src/main/java/org/openapitools/codegen/CliOption.java and SpecValidationException.java, then inspect references to both classes across the generator. Done means CliOption is in org.openapitools.codegen.languages, SpecValidationException is in org.openapitools.codegen.config, and affected references compile with the new package locations.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- tooling
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 42/100