Skip to content

Implement Server Stub Code for Vert.x Web #4286

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

Merged
merged 22 commits into from
Oct 28, 2019

Conversation

lwlee2608
Copy link
Contributor

@lwlee2608 lwlee2608 commented Oct 26, 2019

PR checklist

  • Read the contribution guidelines.
  • If contributing template-only or documentation-only changes which will change sample output, build the project before.
  • Run the shell script(s) under ./bin/ (or Windows batch scripts under.\bin\windows) to update Petstore samples related to your fix. This is important, as CI jobs will verify all generator outputs of your HEAD commit, and these must match the expectations made by your contribution. You only need to run ./bin/{LANG}-petstore.sh, ./bin/openapi3/{LANG}-petstore.sh if updating the code or mustache templates for a language ({LANG}) (e.g. php, ruby, python, etc).
  • File the PR against the correct branch: master, 4.1.x, 5.0.x. Default: master.
  • Copy the technical committee to review the pull request if your PR is targeting a particular programming language.

Description of the PR

Add server generation java-vertx-web which use Vert.x-Web

cc @wing328 @jimschubert @cbornet @ackintosh @jmini @etherealjoy

For #115


# if you've executed sbt assembly previously it will use that instead.
export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties"
ags="generate -i $SPEC -g $GENERATOR --artifact-id java-vertx-web-rx-server -o $STUB_DIR --additional-properties hideGenerationTimestamp=true $@"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor suggestion: adding -t with the resource (template) folder so that we don't need to recompile the whole project if we're only changing the templates.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i see, good idea.

@@ -0,0 +1,162 @@
/*
* Copyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech)
* Copyright 2018 SmartBear Software
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, done


To build the project using maven, run:
```bash
mvn package && java -jar target/target/java-vertx-web-rx-server-1.0.0-SNAPSHOT-fat.jar
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to use {{artifactVersion}} instead of hard-coded 1.0.0-SNAPSHOT?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

my mistake, done

@wing328
Copy link
Member

wing328 commented Oct 27, 2019

Tested locally and the result is good:

[INFO] skip non existing resourceDirectory /private/tmp/vertx2/src/test/resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.3:testCompile (default-testCompile) @ openapi-java-vertx-web-server ---
[INFO] No sources to compile
[INFO] 
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ openapi-java-vertx-web-server ---
[INFO] No tests to run.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.732 s
[INFO] Finished at: 2019-10-27T12:29:13+08:00
[INFO] ------------------------------------------------------------------------

@wing328
Copy link
Member

wing328 commented Oct 27, 2019

Please add a new entry for testing in https://github.com/OpenAPITools/openapi-generator/blob/master/pom.xml#L1166

If the output works with JDK7 as well, please also add an entry to https://github.com/OpenAPITools/openapi-generator/blob/master/pom.xml#L1205

@wing328 wing328 added this to the 4.2.0 milestone Oct 27, 2019
@lwlee2608
Copy link
Contributor Author

@wing328 all comments have been addressed. Please review

The server uses Java8 feature extensively, therefore does not work in JDK7 or lower.

Copy link
Member

@wing328 wing328 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Let's merge it into master and get some feedback from the community.

@wing328
Copy link
Member

wing328 commented Oct 28, 2019

@lwlee2608 thanks for the new generator, which has been merged into master.

For your upcoming PRs, I would recommend creating a new branch as per git best practice.

@wing328 wing328 changed the title Implement Server Stub Code for Vert.x Web #115 Implement Server Stub Code for Vert.x Web Oct 31, 2019
@wing328
Copy link
Member

wing328 commented Oct 31, 2019

@lwlee2608 thanks for the PR, which has been included in v4.2.0 release: https://twitter.com/oas_generator/status/1189824932345069569

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants