-
-
Notifications
You must be signed in to change notification settings - Fork 48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add CancellationToken cancellationToken = default
to generated Methods
#19
Comments
@kirides This is trivial to implement and I can get started with this immediately. Unless you want to give it a shot yourself? |
We're currently in the evaluation phase of deciding to use this tool to generate our clients, sadly i can't provide an implementation at this stage... bureaucracy |
I'm currently trying this out and I can see that Refit doesn't seem to like I generated this code [Get("/pet/{petId}")]
Task<Pet> GetPetById(long petId, CancellationToken cancellationToken = default); But when I run it I just get a
I'm investigating as why this is |
Sounds interesting, manually specifying it in a .NET 6.0 project works fine. Here is the code from refit that checks for its existence (many places call that, and other chains also check for its existence) |
@kirides did you get the interface containing a |
@kirides I honestly couldn't get CancellationToken to work, but if your example works then I trust you on that. Generating code that uses CancellationTokens was trivial to implement and I expect to release this feature this in the afternoon |
This feature is now released as v0.5.0 |
Currently the generated code looks like this
To support timeouts etc. it would be nice to get refitter to add the CancellationToken-parameter like this
The text was updated successfully, but these errors were encountered: