You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat (#19407 JAVA SPRING WEBCLIENT): Add support for useSingleRequestParameter to Spring WebClient (#19827)
* chore (JAVA SPRING WEBCLIENT): Remove comments used for debugging
* feat (JAVA SPRING WEBCLIENT): Add support for useSingleRequestParameter to Spring WebClient
* feat (JAVA SPRING WEBCLIENT): Generate samples and docs
* fix (JAVA SPRING WEBCLIENT): Fix missing return error & Fix JDK17 action webclient useSingleRequestParameter test path
* fix (JAVA SPRING WEBCLIENT): Fix code indention
* fix (JAVA SPRING WEBCLIENT): Fix code indention again
* fix (JAVA SPRING WEBCLIENT): Update samples
* feat (JAVA SPRING WEBCLIENT): Regenerate after pull rebase
Copy file name to clipboardExpand all lines: docs/generators/java-microprofile.md
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -100,7 +100,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
100
100
|useRuntimeException|Use RuntimeException instead of Exception. Only jersey2, jersey3, okhttp-gson, vertx, microprofile support this option.||false|
101
101
|useRxJava2|Whether to use the RxJava2 adapter with the retrofit2 library. IMPORTANT: This option has been deprecated.||false|
102
102
|useRxJava3|Whether to use the RxJava3 adapter with the retrofit2 library. IMPORTANT: This option has been deprecated.||false|
103
-
|useSingleRequestParameter|Setting this property to true will generate functions with a single argument containing all API endpoint parameters instead of one argument per parameter. ONLY jersey2, jersey3, okhttp-gson, microprofile, Spring RestClient support this option.||false|
103
+
|useSingleRequestParameter|Setting this property to true will generate functions with a single argument containing all API endpoint parameters instead of one argument per parameter. ONLY jersey2, jersey3, okhttp-gson, microprofile, Spring RestClient, Spring WebClient support this option.||false|
104
104
|webclientBlockingOperations|Making all WebClient operations blocking(sync). Note that if on operation 'x-webclient-blocking: false' then such operation won't be sync||false|
105
105
|withAWSV4Signature|whether to include AWS v4 signature support (only available for okhttp-gson library)||false|
106
106
|withXml|whether to include support for application/xml content type and include XML annotations in the model (works with libraries that provide support for JSON and XML)||false|
Copy file name to clipboardExpand all lines: docs/generators/java.md
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -100,7 +100,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
100
100
|useRuntimeException|Use RuntimeException instead of Exception. Only jersey2, jersey3, okhttp-gson, vertx, microprofile support this option.||false|
101
101
|useRxJava2|Whether to use the RxJava2 adapter with the retrofit2 library. IMPORTANT: This option has been deprecated.||false|
102
102
|useRxJava3|Whether to use the RxJava3 adapter with the retrofit2 library. IMPORTANT: This option has been deprecated.||false|
103
-
|useSingleRequestParameter|Setting this property to true will generate functions with a single argument containing all API endpoint parameters instead of one argument per parameter. ONLY jersey2, jersey3, okhttp-gson, microprofile, Spring RestClient support this option.||false|
103
+
|useSingleRequestParameter|Setting this property to true will generate functions with a single argument containing all API endpoint parameters instead of one argument per parameter. ONLY jersey2, jersey3, okhttp-gson, microprofile, Spring RestClient, Spring WebClient support this option.||false|
104
104
|webclientBlockingOperations|Making all WebClient operations blocking(sync). Note that if on operation 'x-webclient-blocking: false' then such operation won't be sync||false|
105
105
|withAWSV4Signature|whether to include AWS v4 signature support (only available for okhttp-gson library)||false|
106
106
|withXml|whether to include support for application/xml content type and include XML annotations in the model (works with libraries that provide support for JSON and XML)||false|
Copy file name to clipboardExpand all lines: modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaClientCodegen.java
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -237,7 +237,7 @@ public JavaClientCodegen() {
237
237
cliOptions.add(CliOption.newString(CONFIG_KEY_FROM_CLASS_NAME, "If true, set tag as key in @RegisterRestClient. Default to false. Only `microprofile` supports this option."));
238
238
cliOptions.add(CliOption.newBoolean(CodegenConstants.USE_ONEOF_DISCRIMINATOR_LOOKUP, CodegenConstants.USE_ONEOF_DISCRIMINATOR_LOOKUP_DESC + " Only jersey2, jersey3, native, okhttp-gson support this option."));
239
239
cliOptions.add(CliOption.newString(MICROPROFILE_REST_CLIENT_VERSION, "Version of MicroProfile Rest Client API."));
240
-
cliOptions.add(CliOption.newBoolean(CodegenConstants.USE_SINGLE_REQUEST_PARAMETER, "Setting this property to true will generate functions with a single argument containing all API endpoint parameters instead of one argument per parameter. ONLY jersey2, jersey3, okhttp-gson, microprofile, Spring RestClient support this option."));
240
+
cliOptions.add(CliOption.newBoolean(CodegenConstants.USE_SINGLE_REQUEST_PARAMETER, "Setting this property to true will generate functions with a single argument containing all API endpoint parameters instead of one argument per parameter. ONLY jersey2, jersey3, okhttp-gson, microprofile, Spring RestClient, Spring WebClient support this option."));
241
241
cliOptions.add(CliOption.newBoolean(WEBCLIENT_BLOCKING_OPERATIONS, "Making all WebClient operations blocking(sync). Note that if on operation 'x-webclient-blocking: false' then such operation won't be sync", this.webclientBlockingOperations));
242
242
cliOptions.add(CliOption.newBoolean(GENERATE_CLIENT_AS_BEAN, "For resttemplate, configure whether to create `ApiClient.java` and Apis clients as bean (with `@Component` annotation).", this.generateClientAsBean));
243
243
cliOptions.add(CliOption.newBoolean(SUPPORT_URL_QUERY, "Generate toUrlQueryString in POJO (default to true). Available on `native`, `apache-httpclient` libraries."));
Copy file name to clipboardExpand all lines: modules/openapi-generator/src/main/resources/Java/libraries/restclient/api.mustache
-16Lines changed: 0 additions & 16 deletions
Original file line number
Diff line number
Diff line change
@@ -54,22 +54,6 @@ public class {{classname}} {
54
54
{{#operation}}
55
55
{{#useSingleRequestParameter}}
56
56
{{#hasParams}}
57
-
{{#hasSingleParam}}
58
-
// It has a single param!
59
-
/*
60
-
{{#allParams}}
61
-
* {{paramName}}
62
-
{{/allParams}}
63
-
*/
64
-
{{/hasSingleParam}}
65
-
{{^hasSingleParam}}
66
-
// It has NO single param!
67
-
/*
68
-
{{#allParams}}
69
-
* {{paramName}}
70
-
{{/allParams}}
71
-
*/
72
-
{{/hasSingleParam}}
73
57
{{^hasSingleParam}}
74
58
75
59
public record {{#lambda.titlecase}}{{operationId}}{{/lambda.titlecase}}Request({{#allParams}}{{#isFile}}{{#useAbstractionForFiles}}{{#collectionFormat}}java.util.Collection<org.springframework.core.io.AbstractResource>{{/collectionFormat}}{{^collectionFormat}}org.springframework.core.io.AbstractResource{{/collectionFormat}}{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{dataType}}}{{/useAbstractionForFiles}}{{/isFile}}{{^isFile}}{{{dataType}}}{{/isFile}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}){}
public class {{#lambda.titlecase}}{{operationId}}{{/lambda.titlecase}}Request {
58
+
{{#allParams}}
59
+
private final {{#isFile}}{{#useAbstractionForFiles}}{{#collectionFormat}}java.util.Collection<org.springframework.core.io.AbstractResource>{{/collectionFormat}}{{^collectionFormat}}org.springframework.core.io.AbstractResource{{/collectionFormat}}{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{dataType}}}{{/useAbstractionForFiles}}{{/isFile}}{{^isFile}}{{{dataType}}}{{/isFile}} {{paramName}};
60
+
{{/allParams}}
61
+
62
+
public {{#lambda.titlecase}}{{operationId}}{{/lambda.titlecase}}Request({{#allParams}}{{#isFile}}{{#useAbstractionForFiles}}{{#collectionFormat}}java.util.Collection<org.springframework.core.io.AbstractResource>{{/collectionFormat}}{{^collectionFormat}}org.springframework.core.io.AbstractResource{{/collectionFormat}}{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{dataType}}}{{/useAbstractionForFiles}}{{/isFile}}{{^isFile}}{{{dataType}}}{{/isFile}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) {
63
+
{{#allParams}}
64
+
this.{{paramName}} = {{paramName}};
65
+
{{/allParams}}
66
+
}
67
+
68
+
{{#allParams}}
69
+
public {{#isFile}}{{#useAbstractionForFiles}}{{#collectionFormat}}java.util.Collection<org.springframework.core.io.AbstractResource>{{/collectionFormat}}{{^collectionFormat}}org.springframework.core.io.AbstractResource{{/collectionFormat}}{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{dataType}}}{{/useAbstractionForFiles}}{{/isFile}}{{^isFile}}{{{dataType}}}{{/isFile}} {{paramName}}() {
Copy file name to clipboardExpand all lines: samples/client/others/java/webclient-useAbstractionForFiles/src/main/java/org/openapitools/client/api/ResourceApi.java
+1Lines changed: 1 addition & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -46,6 +46,7 @@ public void setApiClient(ApiClient apiClient) {
Copy file name to clipboardExpand all lines: samples/client/petstore/java/restclient-useSingleRequestParameter/src/main/java/org/openapitools/client/api/AnotherFakeApi.java
-4Lines changed: 0 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -44,10 +44,6 @@ public void setApiClient(ApiClient apiClient) {
44
44
this.apiClient = apiClient;
45
45
}
46
46
47
-
// It has a single param!
48
-
/*
49
-
* client
50
-
*/
51
47
/**
52
48
* To test special tags
53
49
* To test special tags and operation ID starting with number
0 commit comments