swagger-api / swagger-api/swagger-codegen
Add JAVA_OPTS to swagger-generator scripts
Nobody has claimed this yet.
- Dominant language
- Mustache
- Stars
- 17.8k
- Forks
- 6k
- PR merge metrics
- No merged PRs in 30d
Description
We would like to pass some options to the java executor to reduce logging output:
export JAVA_OPTS="${JAVA_OPTS} -Dlog.level=warn --illegal-access=warn"
In the OpenApi generator for example this is done by setting JAVA_OPTS and then calling the script:
> cat $(which openapi-generator)
#!/bin/bash
exec "/usr/local/opt/openjdk/bin/java" $JAVA_OPTS -jar "/usr/local/Cellar/openapi-generator/4.2.3_1/libexec/openapi-generator-cli.jar" "$@"
In swagger-codegen those JAVA_OPTS are ignored:
> cat $(which swagger-codegen)
#!/bin/bash
exec java -jar /usr/local/Cellar/swagger-codegen/3.0.18/libexec/swagger-codegen-cli.jar "$@"
Seems to work when I modify the script and add the options:
/> cat $(which swagger-codegen)
#!/bin/bash
exec java $JAVA_OPTS -jar /usr/local/Cellar/swagger-codegen/3.0.18/libexec/swagger-codegen-cli.jar "$@"
macOS, homebrew, swagger-codegen version 3.0.18
I don't see any discussion about the issue, would it be okay to just add the parameter?
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 by locating the swagger-codegen launcher script or packaging entry point that produces the wrapper shown in the issue, then compare it with the openapi-generator wrapper. Verify that the resulting command passes JAVA_OPTS before the JAR and that existing command-line arguments still work.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, shell
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100