feat (JAVA NATIVE): add support for useSingleRequestParameter to java native client#21331
Conversation
d8839e7 to
0796186
Compare
| @Deprecated | ||
| {{/isDeprecated}} | ||
| public {{#asyncNative}}CompletableFuture<{{/asyncNative}}ApiResponse<{{{returnType}}}{{^returnType}}Void{{/returnType}}>{{#asyncNative}}>{{/asyncNative}} {{operationId}}WithHttpInfo(API{{operationId}}Request apiRequest) throws ApiException { | ||
| public {{#asyncNative}}CompletableFuture<{{/asyncNative}}ApiResponse<{{{returnType}}}{{^returnType}}Void{{/returnType}}>{{#asyncNative}}>{{/asyncNative}} {{operationId}}WithHttpInfo(API{{#lambda.titlecase}}{{operationId}}{{/lambda.titlecase}}Request apiRequest) throws ApiException { |
There was a problem hiding this comment.
thanks for the PR
why do you need to wrap operationId with titlecase lambda?
There was a problem hiding this comment.
@wing328 Without it the operationId as part of the parameter class name would be starting with lowercase. For example it would be “APIdeletePetRequest” without it and “APIDeletePetRequest”. The second one is more camel case and Java typical in my opinion. :)
There was a problem hiding this comment.
so this PR is more like "correcting" the parameter class naming, right?
There was a problem hiding this comment.
@wing328 I "corrected" the parameter class name, yes but I also enabled the generation for the java native client (see the changes in JavaClientCodegen). Before this PR this part was never generated.
| super.postProcessOperationsWithModels(objs, allModels); | ||
|
|
||
| if (this.getSingleRequestParameter() && (isLibrary(JERSEY2) || isLibrary(JERSEY3) || isLibrary(OKHTTP_GSON))) { | ||
| if (this.getSingleRequestParameter() && (isLibrary(JERSEY2) || isLibrary(JERSEY3) || isLibrary(OKHTTP_GSON) || isLibrary(NATIVE))) { |
There was a problem hiding this comment.
@wing328 This PR enables the generation of the single parameter class for the Java native client. Before this PR, enabling ‘useSingleRequestParameter’ doesn’t changed anything for the Java native client.
| * @throws ApiException if fails to make API call | ||
| */ | ||
| public CompletableFuture<Void> testGroupParameters(APItestGroupParametersRequest apiRequest) throws ApiException { | ||
| public CompletableFuture<Void> testGroupParameters(APITestGroupParametersRequest apiRequest) throws ApiException { |
There was a problem hiding this comment.
@Nicklas2751 fyi. i saw this change, which may become a breaking change for other users
for the time, we will consider this as a bug fix to correct the naming and see if there's a need to provide a fallback later (one way to fallback is to use customized templates)
This PR adds support for the
useSingleRequestParameterto the Java native client.PR checklist
Commit all changed files.
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*.IMPORTANT: Do NOT purge/delete any folders/files (e.g. tests) when regenerating the samples as manually written tests may be removed.
master(upcoming7.x.0minor release - breaking changes with fallbacks),8.0.x(breaking changes without fallbacks)@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) @martin-mfg (2023/08)