swagger-api / swagger-api/swagger-codegen
The script new.sh generates a wrong package for test classes
Nobody has claimed this yet.
- Dominant language
- Mustache
- Stars
- 17.8k
- Forks
- 6k
- PR merge metrics
- No merged PRs in 30d
Description
Description
The script new.sh creates test classes with a wrong package if the generator name contains dashes.
openapi-generator version
Since the new.sh was introduced.
Command line used for generation
./new.sh -n java-something -s -t
Steps to reproduce
Execute:
./new.sh -n java-something -s -t
The script generates the class:
modules/openapi-generator/src/test/java/org/openapitools/codegen/java-something/JavaSomethingServerCodegenModelTest.java
that has an invalid character in its package.
Suggest a fix
Ideally, the script should generate the classes in the package
modules/openapi-generator/src/test/java/org/openapitools/codegen/java/something
or, at least, it should state that, with the current implementation, a dash in the generator name is not supported by this script.
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 new.sh and reproduce the issue using ./new.sh -n java-something -s -t. Inspect how the generator name becomes the test package, then verify that the generated Java test class has a valid package path without the dash, or that the script clearly reports the limitation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, shell
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 35/100