-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Add initial version of generating script and the generated client #1
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
Conversation
CLIENT_ROOT=${SCRIPT_ROOT}/.. | ||
|
||
[[ -d ${SCRIPT_ROOT}/bin ]] || mkdir ${SCRIPT_ROOT}/bin | ||
[[ -f ${SCRIPT_ROOT}/bin/swagger-codegen-cli.jar ]] || curl http://repo1.maven.org/maven2/io/swagger/swagger-codegen-cli/2.2.1/swagger-codegen-cli-2.2.1.jar > ${SCRIPT_ROOT}/bin/swagger-codegen-cli.jar |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do they offer a maven task for this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Look like they do: https://github.com/swagger-api/swagger-codegen/blob/master/modules/swagger-codegen-maven-plugin/README.md
Only issue here is I am using an unofficial jar file right now in my bin folder that has my latest fix to codegen If I can specify this in the maven plugin (to use the latest version from repo), I will change this to maven.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
PTAL |
7dbfd45
to
8ff6d11
Compare
fi | ||
|
||
SCRIPT_ROOT=$(dirname "${BASH_SOURCE}") | ||
CLIENT_ROOT=${SCRIPT_ROOT}/.. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you put double quotes around in case the variable contains spaces? There are several occurrences later as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've fixed them all. Please check again and let me know if I missed anything.
mvn -f "${SCRIPT_ROOT}/pom.xml" clean generate-sources -Dgenerator.spec.path="${SWAGGER_FILE}" -Dgenerator.output.path="${CLIENT_ROOT}" -Dgenerator.package.name=${PACKAGE_NAME} | ||
|
||
echo "--- Patching generated code..." | ||
# rm "${CLIENT_ROOT}/git_push.sh" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove this line?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
Friendly ping! |
2ef02b9
to
3e54dbc
Compare
The script lgtm. I'll apply the label and we can improve the generated client in future iteration. @mbohlool feel free to self merge. |
Copy over base folder of python-client
The first pull request for client-python is adding the generation script and a generated client with minimum modification.