Skip to content

Commit 1e971da

Browse files
committed
Merge remote-tracking branch 'upstream/master' into remove-barrel-imports
2 parents df0bd01 + 9fa18d0 commit 1e971da

300 files changed

Lines changed: 5232 additions & 1674 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.

.github/workflows/samples-python-fastapi-server.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
- uses: actions/checkout@v5
2222
- uses: actions/setup-python@v6
2323
with:
24-
python-version: '3.9'
24+
python-version: '3.10'
2525
- name: Install dependencies
2626
working-directory: ${{ matrix.sample }}
2727
run: |

docs/generators/python-fastapi.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ title: Documentation for the python-fastapi Generator
1010
| generator stability | BETA | |
1111
| generator type | SERVER | |
1212
| generator language | Python | |
13-
| generator language version | 3.7 | |
13+
| generator language version | 3.10 | |
1414
| generator default templating engine | mustache | |
1515
| helpTxt | Generates a Python FastAPI server (beta). Models are defined with the pydantic library | |
1616

modules/openapi-generator/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -488,7 +488,7 @@
488488
<dependency>
489489
<groupId>org.assertj</groupId>
490490
<artifactId>assertj-core</artifactId>
491-
<version>3.23.1</version>
491+
<version>3.27.7</version>
492492
<scope>test</scope>
493493
</dependency>
494494
<dependency>

modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PhpNextgenClientCodegen.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,11 @@ public OperationsMap postProcessOperationsWithModels(OperationsMap objs, List<Mo
214214
String phpReturnType = String.join("|", phpReturnTypeOptions);
215215
String docReturnType = String.join("|", docReturnTypeOptions);
216216
if (hasEmptyResponse) {
217-
phpReturnType = "?" + phpReturnType;
217+
if (phpReturnTypeOptions.size() > 1) {
218+
phpReturnType = phpReturnType + "|null";
219+
} else {
220+
phpReturnType = "?" + phpReturnType;
221+
}
218222
docReturnType = docReturnType + "|null";
219223
}
220224

modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonFastAPIServerCodegen.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,7 @@ public void postProcess() {
330330

331331
@Override
332332
public String generatorLanguageVersion() {
333-
return "3.7";
333+
return "3.10";
334334
}
335335

336336
@Override

modules/openapi-generator/src/main/resources/Java/libraries/resteasy/pom.mustache

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@
311311
{{/useJakartaEe}}
312312
<threetenbp-version>2.9.10</threetenbp-version>
313313
<maven-plugin-version>1.0.0</maven-plugin-version>
314-
<assertj-version>3.23.1</assertj-version>
314+
<assertj-version>3.27.7</assertj-version>
315315
<junit-version>5.10.2</junit-version>
316316
</properties>
317317
</project>

modules/openapi-generator/src/main/resources/csharp/libraries/generichost/HostConfiguration.mustache

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ namespace {{packageName}}.{{clientPackage}}
9898
9999
List<IHttpClientBuilder> builders = new List<IHttpClientBuilder>();
100100
101-
{{#apiInfo}}{{#apis}}builders.Add(_services.AddHttpClient<{{interfacePrefix}}{{classname}}, {{classname}}>(client));
101+
{{#apiInfo}}{{#apis}}builders.Add(_services.AddHttpClient<{{interfacePrefix}}{{classname}}, {{classname}}>("{{packageName}}.{{apiPackage}}.{{interfacePrefix}}{{classname}}", client));
102102
{{/apis}}{{/apiInfo}}
103103
if (builder != null)
104104
foreach (IHttpClientBuilder instance in builders)

modules/openapi-generator/src/main/resources/csharp/libraries/generichost/RateLimitProvider`1.mustache

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,11 @@ namespace {{packageName}}.{{clientPackage}}
1616
/// <typeparam name="TTokenBase"></typeparam>
1717
{{>visibility}} class RateLimitProvider<TTokenBase> : TokenProvider<TTokenBase> where TTokenBase : TokenBase
1818
{
19-
public Dictionary<string, global::System.Threading.Channels.Channel<TTokenBase>> AvailableTokens { get; } = new{{^net70OrLater}} Dictionary<string, global::System.Threading.Channels.Channel<TTokenBase>>{{/net70OrLater}}();
19+
/// <summary>
20+
/// Dictionary mapping header names to channels of available tokens for rate limiting.
21+
/// Each channel buffers tokens that have become available and are ready for use.
22+
/// </summary>
23+
protected internal Dictionary<string, global::System.Threading.Channels.Channel<TTokenBase>> AvailableTokens { get; } = new{{^net70OrLater}} Dictionary<string, global::System.Threading.Channels.Channel<TTokenBase>>{{/net70OrLater}}();
2024

2125
/// <summary>
2226
/// Instantiates a ThrottledTokenProvider. Your tokens will be rate limited based on the token's timeout.
@@ -85,7 +89,7 @@ namespace {{packageName}}.{{clientPackage}}
8589
}
8690

8791
/// <inheritdoc/>
88-
public override async System.Threading.Tasks.ValueTask<TTokenBase> GetAsync(string header = "", System.Threading.CancellationToken cancellation = default{{^netstandard20OrLater}}(global::System.Threading.CancellationToken){{/netstandard20OrLater}})
92+
protected internal override async System.Threading.Tasks.ValueTask<TTokenBase> GetAsync(string header = "", System.Threading.CancellationToken cancellation = default{{^netstandard20OrLater}}(global::System.Threading.CancellationToken){{/netstandard20OrLater}})
8993
{
9094
if (!AvailableTokens.TryGetValue(header, out global::System.Threading.Channels.Channel<TTokenBase>{{nrt?}} tokens))
9195
throw new KeyNotFoundException($"Could not locate a token for header '{header}'.");

modules/openapi-generator/src/main/resources/csharp/libraries/generichost/TokenBase.mustache

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,16 @@ namespace {{packageName}}.{{clientPackage}}
1919
private readonly System.Timers.Timer _timer = new System.Timers.Timer();
2020
2121
internal TimeSpan? Timeout { get; set; }
22+
23+
/// <summary>
24+
/// Delegate for token availability notification events.
25+
/// </summary>
26+
/// <param name="sender">The token that became available.</param>
2227
public delegate void TokenBecameAvailableEventHandler(object sender);
28+
29+
/// <summary>
30+
/// Event raised when a rate-limited token becomes available for use.
31+
/// </summary>
2332
public event TokenBecameAvailableEventHandler{{nrt?}} TokenBecameAvailable;
2433

2534
/// <summary>

modules/openapi-generator/src/main/resources/csharp/libraries/generichost/TokenProvider`1.mustache

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,12 @@ namespace {{packageName}}
1616
/// </summary>
1717
{{>visibility}} abstract class TokenProvider<TTokenBase> where TTokenBase : TokenBase
1818
{
19-
public abstract System.Threading.Tasks.ValueTask<TTokenBase> GetAsync(string header = "", System.Threading.CancellationToken cancellation = default{{^netstandard20OrLater}}(global::System.Threading.CancellationToken){{/netstandard20OrLater}});
19+
/// <summary>
20+
/// Gets a token asynchronously for the specified header.
21+
/// </summary>
22+
/// <param name="header">The header name to retrieve a token for. Empty string for non-API-key authentication schemes.</param>
23+
/// <param name="cancellation">Cancellation token for the asynchronous operation.</param>
24+
/// <returns>A task that returns the requested token.</returns>
25+
protected internal abstract System.Threading.Tasks.ValueTask<TTokenBase> GetAsync(string header = "", System.Threading.CancellationToken cancellation = default{{^netstandard20OrLater}}(global::System.Threading.CancellationToken){{/netstandard20OrLater}});
2026
}
2127
}

0 commit comments

Comments
 (0)