swagger-api / swagger-api/swagger-codegen

[JAVA] VM arguments -DapiPackage, -DmodelPackage, -DinvokerPackage not working

Open
#5,902 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Description

When generating Java client VM arguments -DapiPackage, -DmodelPackage, -DinvokerPackage are not working (or I'm not doing it right).

Swagger-codegen version

jar built from master

Swagger declaration file content or url

http://petstore.swagger.io/v2/swagger.json

Command line used for generation / Steps to reproduce

git clone https://github.com/swagger-api/swagger-codegen
cd swagger-codegen
mvn clean package
cd ..

java -DinvokerPackage="com.mycompany.foo" \
    -DmodelPackage="com.mycompany.foo.model" \
    -DapiPackage="com.mycompany.foo.api" \
    -jar swagger-codegen/modules/swagger-codegen-cli/target/swagger-codegen-cli.jar generate \
    -i http://petstore.swagger.io/v2/swagger.json \
    -l java \
    -o testing_vm_args \
    >codegen_out 2>&1

Output

gist. Note that all packages are the default /io/swagger/

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.

Research direction

Reproduce the issue with the Java generation command shown in the report and the petstore Swagger definition. Start by tracing how -DapiPackage, -DmodelPackage, and -DinvokerPackage are read during Java client generation, then compare the generated output with the requested package names. Done means the generated client uses the three supplied package values instead of the default io.swagger packages.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.