-
-
Notifications
You must be signed in to change notification settings - Fork 777
Open
Labels
Description
Describe the bug 🐞
After migration from version 8.0.0 to 9.0.2 CancellationToken? cancellationToken causes exception:
Index was outside the bounds of the array.
Stack Trace:
at Internal.Runtime.CompilerHelpers.ThrowHelpers.ThrowIndexOutOfRangeException()
at Refit.RequestBuilderImplementation.<>c__DisplayClass22_0.<BuildRequestFactoryForMethod>b__0(Object[] paramList)
at Refit.RequestBuilderImplementation.<>c__DisplayClass18_0`2.<<BuildCancellableTaskFuncForMethod>b__0>d.MoveNext()
Client definition (obfuscated)
[Post("/api/a/{id}/b/c")]
Task<Dto> Create(Guid id, [Body] Dto2 requestBody, CancellationToken? cancellationToken);
Step to reproduce
- Use Refit with version 9.0.2
- Use client definition in description
- Exception is thrown in runtime
Reproduction repository
https://github.com/reactiveui/refit
Expected behavior
This should work and not throw exception.
Refit Version
9.0.2
Additional information ℹ️
In old version 8.0.0 it worked.
Changing it to CancellationToken cancellationToken = default seems to work.