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
When generating the server as a library, the Task methods don't have the CancellationToken parameter.
This is because the template currently renders the CancellationToken only if the options operationResultTask and operationIsAsync are set to true. But operationIsAsync is always false in the case of a library output.
This fix intends to render the CancellationToken only under the operationResultTask option.
openapi-generator version
Latest. Not a regression as the CancellationToken generation has been introduced in Jan 2023 and has been working as described above since then.
Description
When generating the server as a library, the Task methods don't have the CancellationToken parameter.
This is because the template currently renders the CancellationToken only if the options
operationResultTask
andoperationIsAsync
are set to true. But operationIsAsync is always false in the case of a library output.This fix intends to render the CancellationToken only under the operationResultTask option.
openapi-generator version
Latest. Not a regression as the CancellationToken generation has been introduced in Jan 2023 and has been working as described above since then.
OpenAPI declaration file content or url
Command line used for generation
docker run --rm -v C:\Users\xxx\source\repos\OpenAPI_aspnetcore_CancellationTokenTest\repro:/src openapitools/openapi-generator-cli:latest generate -i /src/spec/combined_openapi.yaml -g aspnetcore -o /src/gen -c /src/generator/generator-config.yaml
Content of the generator-config.yaml:
Steps to reproduce
No CancellationToken generator in the controller method
Related issues/PRs
Introduction of CancellationToken:
#14326
operationIsAsync explicitly hard coded to false in the library output case:
#2629
The text was updated successfully, but these errors were encountered: