More of a feature request than an issue. Would it be possible to generate async methods with CancellationToken support?
@jonsa do you mean a method to submit a HTTP request to cancel/void a token somehow?
No I don't, I think? :)
Async methods are usually implemented in two flavors
```c#
public Task MyAsync(object arg1, object arg2)
{
return MyAsync(arg1, arg2, CancellationToken.None);
}
public Task MyAsync(object arg1, object arg2, CancellationToken cancellationToken)
{
// ...
}
```
And so does RestSharp RestClient.
What I'd like is for the generated client to use the async methods with CancellationToken support.
I haven't found the time to fully understand what it would take to implement but I've looked around a little to get a sense of it. The way I picture it, it is quite a simple refactoring process.
@ozziepeeps @wing328 - it looks like the above PR was never merged, and we still don't have CancellationToken support in Swagger. What is the current status?
Hi @smflorentino, you are welcome to merge the PR if it meets your needs. Thanks
Is there any reason, why the PR is not yet merged, but closed?
Most helpful comment
No I don't, I think? :)
Async methods are usually implemented in two flavors
```c#
public Task MyAsync(object arg1, object arg2)
{
return MyAsync(arg1, arg2, CancellationToken.None);
}
public Task MyAsync(object arg1, object arg2, CancellationToken cancellationToken)
{
// ...
}
```
And so does RestSharp RestClient.
What I'd like is for the generated client to use the async methods with CancellationToken support.
I haven't found the time to fully understand what it would take to implement but I've looked around a little to get a sense of it. The way I picture it, it is quite a simple refactoring process.