[Java][Client] Add Quarkus support#8716
[Java][Client] Add Quarkus support#8716djnalluri wants to merge 4 commits intoOpenAPITools:masterfrom oaklandcorp:quarkus-mp-client
Conversation
| } else if (SERIALIZATION_LIBRARY_GSON.equals(getSerializationLibrary())) { | ||
| additionalProperties.put(SERIALIZATION_LIBRARY_GSON, "true"); | ||
| additionalProperties.remove(SERIALIZATION_LIBRARY_JACKSON); | ||
| additionalProperties.remove(SERIALIZATION_LIBRARY_JSONB); |
There was a problem hiding this comment.
this is the place where you should use switch/case for these instead adding another else if
| model.imports.add("IOException"); | ||
| } | ||
| if (additionalProperties.containsKey(SERIALIZATION_LIBRARY_JSONB)) { | ||
| //TODO: Fill this out |
There was a problem hiding this comment.
I left it intentionally blank as a marker for future optimization. But indeed, it should be removed or stated to be so.
| model.imports.remove("ApiModel"); | ||
| model.imports.remove("JsonSerialize"); | ||
| model.imports.remove("ToStringSerializer"); | ||
| // if (MICROPROFILE.equals(getLibrary())) { |
There was a problem hiding this comment.
revert commented out or fix and remove
| this.serializationLibrary = SERIALIZATION_LIBRARY_JACKSON; | ||
| } else if (SERIALIZATION_LIBRARY_GSON.equalsIgnoreCase(serializationLibrary)) { | ||
| this.serializationLibrary = SERIALIZATION_LIBRARY_GSON; | ||
| } else if (SERIALIZATION_LIBRARY_JSONB.equalsIgnoreCase(serializationLibrary)) { |
There was a problem hiding this comment.
another place for switch/case
| } | ||
|
|
||
| @Override | ||
| public Map<String, String> typeMapping() { |
There was a problem hiding this comment.
I dont think this override is needed here. typeMapping() is defined as public method in DefaultCodeGen and this doesnt change any behaviour. it returns the same typeMapping hashmap.
| } | ||
|
|
||
| /** | ||
| /** |
There was a problem hiding this comment.
extra whitespace adds chaos to review
| * Get firstName | ||
| * @return firstName | ||
| **/ | ||
| @javax.annotation.Nullable |
There was a problem hiding this comment.
this should land in its own PR
| * (except the first line). | ||
| */ | ||
| private static String toIndentedString(Object o) { | ||
| private String toIndentedString(Object o) { |
There was a problem hiding this comment.
this is potentially a breaking change with no fallback config
| return this; | ||
|
|
||
| @Override | ||
| public boolean equals(Object o) { |
There was a problem hiding this comment.
This also belongs in its own PR, only adds chaos to this review that's long already
|
As it's a good effort I think this PR has way too many changes to go all in, it should be at last 4-7. There are at least 2 breaking changes in here as well, rename of config flag, change of static method (which looks to be static intentionally). |
|
I'm closing this PR and will break it up into multiple PR's as suggested. Thanks for the feedback. |
|
@djnalluri was this ever implemented? I am looking for Quarkus support of Microprofile. |
|
This hasn't been implemented yet. The series of PR's I was hoping to break things into are layered on each other. Progress on this is stuck on #8801. You could check out the Quarkiverse plugin. It uses OpenAPI generator under the hood. https://github.com/quarkiverse/quarkus-openapi-generator |
|
OK you rock this Quarkiverse plugin looks like exactly what I am looking for. |
This PR adds support for Quarkus in the Microprofile library for the Java client. These changes, for the most part, should not affect any existing usage with the exception of
disableMultipartbeing renamed toenableMultipartand new annotations being used whenwithXmlis enabled. To generate for Quarkus, set the library tomicroprofileand add the additional property namedmicroprofileFrameworkset toquarkus.Summary of changes:
PR checklist
This is important, as CI jobs will verify all generator outputs of your HEAD commit as it would merge with master.
These must match the expectations made by your contribution.
You may regenerate an individual generator by passing the relevant config(s) as an argument to the script, for example
./bin/generate-samples.sh bin/configs/java*.For Windows users, please run the script in Git BASH.
master,5.1.x,6.0.xTechnical Committee:
@bbdouglas (2017/07) @sreeshas (2017/08) @jfiala (2017/08) @lukoyanov (2017/09) @cbornet (2017/09) @jeff9finger (2018/01) @karismann (2019/03) @Zomzog (2019/04) @lwlee2608 (2019/10) @nmuesch (2021/01)