Skip to content

Commit 004bd2b

Browse files
committed
Do not reinitialize ClientConfig with default values when building HTTP Client
1 parent 9374dbd commit 004bd2b

453 files changed

Lines changed: 8547 additions & 2577 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

docs/generators/java-camel.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,6 @@ These options may be applied as additional-properties (cli) or configOptions (pl
103103
|useOneOfInterfaces|whether to use a java interface to describe a set of oneOf options, where each option is a class that implements the interface| |false|
104104
|useOptional|Use Optional container for optional parameters| |false|
105105
|useResponseEntity|Use the `ResponseEntity` type to wrap return values of generated API methods. If disabled, method are annotated using a `@ResponseStatus` annotation, which has the status of the first response declared in the Api definition| |true|
106-
|useSealed|Whether to generate sealed model interfaces and classes| |false|
107106
|useSpringBoot3|Generate code and provide dependencies for use with Spring Boot 3.x. (Use jakarta instead of javax in imports). Enabling this option will also enable `useJakartaEe`.| |false|
108107
|useSpringController|Annotate the generated API as a Spring Controller| |false|
109108
|useSwaggerUI|Open the OpenApi specification in swagger-ui. Will also import and configure needed dependencies| |true|

docs/generators/java-microprofile.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
100100
|useRuntimeException|Use RuntimeException instead of Exception. Only jersey2, jersey3, okhttp-gson, vertx, microprofile support this option.| |false|
101101
|useRxJava2|Whether to use the RxJava2 adapter with the retrofit2 library. IMPORTANT: This option has been deprecated.| |false|
102102
|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, Spring WebClient support this option. Setting this property to "static" does the same as "true", but also makes the generated arguments class static. Only WebClient supports 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|
104104
|webclientBlockingOperations|Making all WebClient operations blocking(sync). Note that if on operation 'x-webclient-blocking: false' then such operation won't be sync| |false|
105105
|withAWSV4Signature|whether to include AWS v4 signature support (only available for okhttp-gson library)| |false|
106106
|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|

docs/generators/java.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
100100
|useRuntimeException|Use RuntimeException instead of Exception. Only jersey2, jersey3, okhttp-gson, vertx, microprofile support this option.| |false|
101101
|useRxJava2|Whether to use the RxJava2 adapter with the retrofit2 library. IMPORTANT: This option has been deprecated.| |false|
102102
|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, Spring WebClient support this option. Setting this property to "static" does the same as "true", but also makes the generated arguments class static. Only WebClient supports 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|
104104
|webclientBlockingOperations|Making all WebClient operations blocking(sync). Note that if on operation 'x-webclient-blocking: false' then such operation won't be sync| |false|
105105
|withAWSV4Signature|whether to include AWS v4 signature support (only available for okhttp-gson library)| |false|
106106
|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|

docs/generators/php-laravel.md

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ title: Documentation for the php-laravel Generator
1111
| generator type | SERVER | |
1212
| generator language | PHP | |
1313
| generator default templating engine | mustache | |
14-
| helpTxt | Generates a php-laravel server. | |
14+
| helpTxt | Generates a PHP laravel server library. | |
1515

1616
## CONFIG OPTIONS
1717
These options may be applied as additional-properties (cli) or configOptions (plugins). Refer to [configuration docs](https://openapi-generator.tech/docs/configuration) for more details.
@@ -22,7 +22,6 @@ These options may be applied as additional-properties (cli) or configOptions (pl
2222
|apiPackage|package for generated api classes| |null|
2323
|artifactUrl|artifact URL in generated pom.xml| |null|
2424
|artifactVersion|The version to use in the composer package version field. e.g. 1.2.3| |null|
25-
|autowire|Should autowire be enabled.| |false|
2625
|composerPackageName|The name to use in the composer package name field. e.g. `vendor/project` (must be lowercase and consist of words separated by `-`, `.` or `_`).| |null|
2726
|developerOrganization|developer organization in generated pom.xml| |null|
2827
|developerOrganizationUrl|developer organization URL in generated pom.xml| |null|
@@ -58,7 +57,6 @@ These options may be applied as additional-properties (cli) or configOptions (pl
5857

5958
<ul class="column-ul">
6059
<li>\DateTime</li>
61-
<li>\Illuminate\Http\UploadedFile</li>
6260
<li>\SplFileObject</li>
6361
<li>array</li>
6462
<li>bool</li>
@@ -202,7 +200,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
202200
### Documentation Feature
203201
| Name | Supported | Defined By |
204202
| ---- | --------- | ---------- |
205-
|Readme||ToolingExtension
203+
|Readme||ToolingExtension
206204
|Model|✓|ToolingExtension
207205
|Api|✓|ToolingExtension
208206

@@ -222,7 +220,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
222220
|MultiServer|✗|OAS3
223221
|ParameterizedServer|✗|OAS3
224222
|ParameterStyling|✗|OAS3
225-
|Callbacks||OAS3
223+
|Callbacks||OAS3
226224
|LinkObjects|✗|OAS3
227225

228226
### Parameter Feature
@@ -241,7 +239,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
241239
| ---- | --------- | ---------- |
242240
|Simple|✓|OAS2,OAS3
243241
|Composite|✓|OAS2,OAS3
244-
|Polymorphism||OAS2,OAS3
242+
|Polymorphism||OAS2,OAS3
245243
|Union|✗|OAS3
246244
|allOf|✗|OAS2,OAS3
247245
|anyOf|✗|OAS3
@@ -251,14 +249,14 @@ These options may be applied as additional-properties (cli) or configOptions (pl
251249
### Security Feature
252250
| Name | Supported | Defined By |
253251
| ---- | --------- | ---------- |
254-
|BasicAuth||OAS2,OAS3
255-
|ApiKey||OAS2,OAS3
252+
|BasicAuth||OAS2,OAS3
253+
|ApiKey||OAS2,OAS3
256254
|OpenIDConnect|✗|OAS3
257-
|BearerToken||OAS3
258-
|OAuth2_Implicit||OAS2,OAS3
259-
|OAuth2_Password||OAS2,OAS3
260-
|OAuth2_ClientCredentials||OAS2,OAS3
261-
|OAuth2_AuthorizationCode||OAS2,OAS3
255+
|BearerToken||OAS3
256+
|OAuth2_Implicit||OAS2,OAS3
257+
|OAuth2_Password||OAS2,OAS3
258+
|OAuth2_ClientCredentials||OAS2,OAS3
259+
|OAuth2_AuthorizationCode||OAS2,OAS3
262260
|SignatureAuth|✗|OAS3
263261
|AWSV4Signature|✗|ToolingExtension
264262

docs/generators/protobuf-schema.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
1919
| Option | Description | Values | Default |
2020
| ------ | ----------- | ------ | ------- |
2121
|numberedFieldNumberList|Field numbers in order.| |false|
22-
|startEnumsWithUnspecified|Introduces &quot;UNSPECIFIED&quot; as the first element of enumerations.| |false|
22+
|startEnumsWithUnknown|Introduces &quot;UNKNOWN&quot; as the first element of enumerations.| |false|
2323

2424
## IMPORT MAPPING
2525

docs/generators/rust-axum.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -209,16 +209,16 @@ These options may be applied as additional-properties (cli) or configOptions (pl
209209
|Union|✗|OAS3
210210
|allOf|✗|OAS2,OAS3
211211
|anyOf|✗|OAS3
212-
|oneOf||OAS3
212+
|oneOf||OAS3
213213
|not|✗|OAS3
214214

215215
### Security Feature
216216
| Name | Supported | Defined By |
217217
| ---- | --------- | ---------- |
218-
|BasicAuth||OAS2,OAS3
218+
|BasicAuth||OAS2,OAS3
219219
|ApiKey|✓|OAS2,OAS3
220220
|OpenIDConnect|✗|OAS3
221-
|BearerToken||OAS3
221+
|BearerToken||OAS3
222222
|OAuth2_Implicit|✗|OAS2,OAS3
223223
|OAuth2_Password|✗|OAS2,OAS3
224224
|OAuth2_ClientCredentials|✗|OAS2,OAS3

docs/generators/spring.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,6 @@ These options may be applied as additional-properties (cli) or configOptions (pl
9696
|useOneOfInterfaces|whether to use a java interface to describe a set of oneOf options, where each option is a class that implements the interface| |false|
9797
|useOptional|Use Optional container for optional parameters| |false|
9898
|useResponseEntity|Use the `ResponseEntity` type to wrap return values of generated API methods. If disabled, method are annotated using a `@ResponseStatus` annotation, which has the status of the first response declared in the Api definition| |true|
99-
|useSealed|Whether to generate sealed model interfaces and classes| |false|
10099
|useSpringBoot3|Generate code and provide dependencies for use with Spring Boot 3.x. (Use jakarta instead of javax in imports). Enabling this option will also enable `useJakartaEe`.| |false|
101100
|useSpringController|Annotate the generated API as a Spring Controller| |false|
102101
|useSwaggerUI|Open the OpenApi specification in swagger-ui. Will also import and configure needed dependencies| |true|

modules/openapi-generator/src/main/resources/Java/libraries/jersey2/ApiClient.mustache

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -694,6 +694,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} {
694694
*/
695695
public ApiClient setDebugging(boolean debugging) {
696696
this.debugging = debugging;
697+
applyDebugSetting(this.clientConfig);
697698
// Rebuild HTTP Client according to the new "debugging" value.
698699
this.httpClient = buildHttpClient();
699700
return this;
@@ -1383,8 +1384,10 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} {
13831384
* @return Client
13841385
*/
13851386
protected Client buildHttpClient() {
1386-
// recreate the client config to pickup changes
1387-
clientConfig = getDefaultClientConfig();
1387+
// Create ClientConfig if it has not been initialized yet
1388+
if (clientConfig == null) {
1389+
clientConfig = getDefaultClientConfig();
1390+
}
13881391

13891392
ClientBuilder clientBuilder = ClientBuilder.newBuilder();
13901393
clientBuilder = clientBuilder.withConfig(clientConfig);
@@ -1405,6 +1408,11 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} {
14051408
clientConfig.property(HttpUrlConnectorProvider.SET_METHOD_WORKAROUND, true);
14061409
// turn off compliance validation to be able to send payloads with DELETE calls
14071410
clientConfig.property(ClientProperties.SUPPRESS_HTTP_COMPLIANCE_VALIDATION, true);
1411+
applyDebugSetting(clientConfig);
1412+
return clientConfig;
1413+
}
1414+
1415+
private void applyDebugSetting(ClientConfig clientConfig) {
14081416
if (debugging) {
14091417
clientConfig.register(new LoggingFeature(java.util.logging.Logger.getLogger(LoggingFeature.DEFAULT_LOGGER_NAME), java.util.logging.Level.INFO, LoggingFeature.Verbosity.PAYLOAD_ANY, 1024*50 /* Log payloads up to 50K */));
14101418
clientConfig.property(LoggingFeature.LOGGING_FEATURE_VERBOSITY, LoggingFeature.Verbosity.PAYLOAD_ANY);
@@ -1414,8 +1422,6 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} {
14141422
// suppress warnings for payloads with DELETE calls:
14151423
java.util.logging.Logger.getLogger("org.glassfish.jersey.client").setLevel(java.util.logging.Level.SEVERE);
14161424
}
1417-
1418-
return clientConfig;
14191425
}
14201426

14211427
/**

samples/client/echo_api/php-nextgen-streaming/src/Api/QueryApi.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1778,7 +1778,7 @@ public function testQueryStyleDeepObjectExplodeTrueObjectAllOfRequest(
17781778
$queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
17791779
$query_object,
17801780
'query_object', // param base name
1781-
'\OpenAPIClientModelBirdOpenAPIClientModelCategory', // openApiType
1781+
'Bird', // openApiType
17821782
'deepObject', // style
17831783
true, // explode
17841784
false // required
@@ -3368,7 +3368,7 @@ public function testQueryStyleFormExplodeTrueObjectAllOfRequest(
33683368
$queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
33693369
$query_object,
33703370
'query_object', // param base name
3371-
'ObjectOpenAPIClientModelQuery', // openApiType
3371+
'object', // openApiType
33723372
'form', // style
33733373
true, // explode
33743374
false // required

samples/client/echo_api/php-nextgen/src/Api/QueryApi.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1778,7 +1778,7 @@ public function testQueryStyleDeepObjectExplodeTrueObjectAllOfRequest(
17781778
$queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
17791779
$query_object,
17801780
'query_object', // param base name
1781-
'\OpenAPIClientModelBirdOpenAPIClientModelCategory', // openApiType
1781+
'Bird', // openApiType
17821782
'deepObject', // style
17831783
true, // explode
17841784
false // required
@@ -3368,7 +3368,7 @@ public function testQueryStyleFormExplodeTrueObjectAllOfRequest(
33683368
$queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
33693369
$query_object,
33703370
'query_object', // param base name
3371-
'ObjectOpenAPIClientModelQuery', // openApiType
3371+
'object', // openApiType
33723372
'form', // style
33733373
true, // explode
33743374
false // required

0 commit comments

Comments
 (0)