Skip to content

Commit 9efbc3e

Browse files
authored
Merge branch 'OpenAPITools:master' into php-formdata-fix
2 parents ff99320 + 31c1a86 commit 9efbc3e

File tree

649 files changed

+2656
-2972
lines changed

Some content is hidden

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

649 files changed

+2656
-2972
lines changed

modules/openapi-generator/src/main/java/org/openapitools/codegen/config/GlobalSettings.java

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,13 @@ public class GlobalSettings {
3838

3939
private static final Logger LOGGER = LoggerFactory.getLogger(GlobalSettings.class);
4040

41-
private static ThreadLocal<Properties> properties = new InheritableThreadLocal<Properties>() {
41+
private static ThreadLocal<Properties> properties = new InheritableThreadLocal<>() {
4242
@Override
4343
protected Properties initialValue() {
4444
// avoid using System.getProperties().clone() which is broken in Gradle - see https://github.com/gradle/gradle/issues/17344
4545
Properties copy = new Properties();
46-
copy.putAll(System.getProperties());
46+
System.getProperties()
47+
.forEach((k,v) -> copy.put(String.valueOf(k), String.valueOf(v)));
4748
return copy;
4849
}
4950
};
@@ -69,8 +70,10 @@ public static void reset() {
6970
}
7071

7172
public static void log() {
72-
StringWriter stringWriter = new StringWriter();
73-
properties.get().list(new PrintWriter(stringWriter));
74-
LOGGER.debug("GlobalSettings: {}", stringWriter);
73+
if(LOGGER.isDebugEnabled()) {
74+
StringWriter stringWriter = new StringWriter();
75+
properties.get().list(new PrintWriter(stringWriter));
76+
LOGGER.debug("GlobalSettings: {}", stringWriter);
77+
}
7578
}
7679
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -658,7 +658,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} {
658658
MediaType contentType, String[] authNames) {
659659
updateParamsForAuth(authNames, queryParams, headerParams, cookieParams);
660660
661-
final UriComponentsBuilder builder = UriComponentsBuilder.fromHttpUrl(basePath).path(path);
661+
final UriComponentsBuilder builder = UriComponentsBuilder.fromUriString(basePath).path(path);
662662
663663
String finalUri = builder.build(false).toUriString();
664664
Map<String, Object> uriParams = new HashMap<>();

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -754,7 +754,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} {
754754
finalUri += "?" + queryUri;
755755
}
756756
String expandedPath = this.expandPath(finalUri, uriParams);
757-
final UriComponentsBuilder builder = UriComponentsBuilder.fromHttpUrl(basePath).path(expandedPath);
757+
final UriComponentsBuilder builder = UriComponentsBuilder.fromUriString(basePath).path(expandedPath);
758758
759759
URI uri;
760760
try {
@@ -763,7 +763,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} {
763763
throw new RestClientException("Could not build URL: " + builder.toUriString(), ex);
764764
}
765765
766-
final BodyBuilder requestBuilder = RequestEntity.method(method, UriComponentsBuilder.fromHttpUrl(basePath).toUriString() + finalUri, uriParams);
766+
final BodyBuilder requestBuilder = RequestEntity.method(method, UriComponentsBuilder.fromUriString(basePath).toUriString() + finalUri, uriParams);
767767
if (accept != null) {
768768
requestBuilder.accept(accept.toArray(new MediaType[accept.size()]));
769769
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -666,7 +666,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} {
666666
MediaType contentType, String[] authNames) {
667667
updateParamsForAuth(authNames, queryParams, headerParams, cookieParams);
668668
669-
final UriComponentsBuilder builder = UriComponentsBuilder.fromHttpUrl(basePath).path(path);
669+
final UriComponentsBuilder builder = UriComponentsBuilder.fromUriString(basePath).path(path);
670670
671671
String finalUri = builder.build(false).toUriString();
672672
Map<String, Object> uriParams = new HashMap<>();

modules/openapi-generator/src/main/resources/python/README_onlypackage.mustache

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ This python library package is generated without supporting files like setup.py
2626

2727
To be able to use it, you will need these dependencies in your own package that uses this library:
2828

29-
* urllib3 >= 1.25.3, < 3.0.0
29+
* urllib3 >= 2.1.0, < 3.0.0
3030
* python-dateutil >= 2.8.2
3131
{{#asyncio}}
3232
* aiohttp >= 3.8.4

modules/openapi-generator/src/main/resources/python/pyproject.mustache

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ include = ["{{packageName}}/py.typed"]
1212
[tool.poetry.dependencies]
1313
python = "^3.8"
1414

15-
urllib3 = ">= 1.25.3, < 3.0.0"
15+
urllib3 = ">= 2.1.0, < 3.0.0"
1616
python-dateutil = ">= 2.8.2"
1717
{{#asyncio}}
1818
aiohttp = ">= 3.8.4"

modules/openapi-generator/src/main/resources/python/requirements.mustache

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
urllib3 >= 1.25.3, < 3.0.0
1+
urllib3 >= 2.1.0, < 3.0.0
22
python_dateutil >= 2.8.2
33
{{#asyncio}}
44
aiohttp >= 3.8.4

modules/openapi-generator/src/main/resources/python/setup.mustache

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ NAME = "{{{projectName}}}"
1414
VERSION = "{{packageVersion}}"
1515
PYTHON_REQUIRES = ">= 3.8"
1616
REQUIRES = [
17-
"urllib3 >= 1.25.3, < 3.0.0",
17+
"urllib3 >= 2.1.0, < 3.0.0",
1818
"python-dateutil >= 2.8.2",
1919
{{#asyncio}}
2020
"aiohttp >= 3.8.4",

modules/openapi-generator/src/main/resources/swift6/APIHelper.mustache

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ import Foundation{{#useVapor}}
88
import Vapor{{/useVapor}}
99

1010
{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} struct APIHelper {
11-
{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} static func rejectNil(_ source: [String: Any?]) -> [String: Any]? {
12-
let destination = source.reduce(into: [String: Any]()) { result, item in
11+
{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} static func rejectNil(_ source: [String: (any Sendable)?]) -> [String: any Sendable]? {
12+
let destination = source.reduce(into: [String: any Sendable]()) { result, item in
1313
if let value = item.value {
1414
result[item.key] = value
1515
}
@@ -21,7 +21,7 @@ import Vapor{{/useVapor}}
2121
return destination
2222
}
2323

24-
{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} static func rejectNilHeaders(_ source: [String: Any?]) -> [String: String] {
24+
{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} static func rejectNilHeaders(_ source: [String: (any Sendable)?]) -> [String: String] {
2525
return source.reduce(into: [String: String]()) { result, item in
2626
if let collection = item.value as? [Any?] {
2727
result[item.key] = collection
@@ -33,12 +33,12 @@ import Vapor{{/useVapor}}
3333
}
3434
}
3535

36-
{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} static func convertBoolToString(_ source: [String: Any]?) -> [String: Any]? {
36+
{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} static func convertBoolToString(_ source: [String: any Sendable]?) -> [String: any Sendable]? {
3737
guard let source = source else {
3838
return nil
3939
}
4040

41-
return source.reduce(into: [String: Any]()) { result, item in
41+
return source.reduce(into: [String: any Sendable]()) { result, item in
4242
switch item.value {
4343
case let x as Bool:
4444
result[item.key] = x.description
@@ -100,7 +100,7 @@ import Vapor{{/useVapor}}
100100
/// maps all values from source to query parameters
101101
///
102102
/// collection values are always exploded
103-
{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} static func mapValuesToQueryItems(_ source: [String: Any?]) -> [URLQueryItem]? {
103+
{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} static func mapValuesToQueryItems(_ source: [String: (any Sendable)?]) -> [URLQueryItem]? {
104104
let destination = source.filter { $0.value != nil }.reduce(into: [URLQueryItem]()) { result, item in
105105
if let collection = item.value as? [Any?] {
106106
collection

modules/openapi-generator/src/main/resources/swift6/APIs.mustache

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ import Alamofire{{/useAlamofire}}
8585
{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}open{{/nonPublicApi}} class RequestBuilder<T>: @unchecked Sendable {
8686
{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} var credential: URLCredential?
8787
{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} var headers: [String: String]
88-
{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} let parameters: [String: Any]?
88+
{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} let parameters: [String: any Sendable]?
8989
{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} let method: String
9090
{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} let URLString: String
9191
{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} let requestTask: RequestTask = RequestTask()
@@ -95,7 +95,7 @@ import Alamofire{{/useAlamofire}}
9595
/// Optional block to obtain a reference to the request's progress instance when available.
9696
{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} var onProgressReady: ((Progress) -> Void)?
9797

98-
required {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} init(method: String, URLString: String, parameters: [String: Any]?, headers: [String: String] = [:], requiresAuthentication: Bool, apiConfiguration: {{projectName}}APIConfiguration = {{projectName}}APIConfiguration.shared) {
98+
required {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} init(method: String, URLString: String, parameters: [String: any Sendable]?, headers: [String: String] = [:], requiresAuthentication: Bool, apiConfiguration: {{projectName}}APIConfiguration = {{projectName}}APIConfiguration.shared) {
9999
self.method = method
100100
self.URLString = URLString
101101
self.parameters = parameters

0 commit comments

Comments
 (0)