-
-
Notifications
You must be signed in to change notification settings - Fork 6.7k
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
Java 11 native HTTP client library #3434
Conversation
This is intended to resolve #3433 |
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.
Looks great! Thanks a lot!
I haven't tested it, though.
Might it be possible to add a small integration test to avoid breaking this code in the future?
@bbdouglas can you please run |
@macjohnny I went ahead and completed the tasks you suggested:
Note, I ran |
@bbdouglas thanks for the changes! Line 1108 in 2f479f4
and add a pom.xml that references your tests, see e.g.https://github.com/OpenAPITools/openapi-generator/blob/master/samples/client/petstore/java/rest-assured/pom.xml |
0076062
to
a0753cd
Compare
Hi @macjohnny , thanks for the heads up about #3455 . I went ahead and rebased and added a JSR305 dependency to the pom/gradle templates to support the new I have a pom in |
Very good point. We may need to test it in Shippable or another CI running JDK11+. I'm in the process to setup another CI (free) so maybe we can use that one to test this new client. More on this later. |
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.
LGTM
FYI. Setup drone.io (CI) to cover the Java native client: #3472 |
Added @bbdouglas as the template creator via b9e863a |
@bbdouglas thanks for the PR, which has been included in the 4.1.0 release: https://twitter.com/oas_generator/status/1160000504455319553 |
PR checklist
./bin/
to update Petstore sample so that CIs can verify the change. (For instance, only need to run./bin/{LANG}-petstore.sh
,./bin/openapi3/{LANG}-petstore.sh
if updating the {LANG} (e.g. php, ruby, python, etc) code generator or {LANG} client's mustache templates). Windows batch files can be found in.\bin\windows\
. If contributing template-only or documentation-only changes which will change sample output, be sure to build the project first.master
,4.1.x
,5.0.x
. Default:master
.Description of the PR
This is a set of mustache templates to create a new Java library called "native" that is backed by the standard Java 11 HTTPClient class.
The majority of files are only lightly edited from the default Java templates. The model classes, for example, are entirely untouched. The main two edits are:
It follows the pattern used by Jersey, where the APIClient acts as a mechanism for configuring the clients along with a small repository of utility functions. The individual api classes are created from the settings and helper classes held by the APIClient, and are immutable and thread-safe. Object serialization/deserialization is handled by Jackson, as is common in the other libraries.
We at Yelp currently use these templates to generate clientlibs used in our production microservices architecture. This library lacks some of the features seen in other openapi-generator libraries, but represents a fully functional subset for our use case. Additional features could be added on as needed. Here is a summary of the limitations of the current clientlibs:
resolves #3433