refit icon indicating copy to clipboard operation
refit copied to clipboard

Fix condition of method return type in RequestBuilder to only allow Task<> and IObservable<>

Open barchkile opened this issue 3 years ago • 1 comments

What kind of change does this PR introduce? Bug fix

What is the current behavior? Generic return type of any type is allowed in the creation of REST client

What is the new behavior? Generic return type in method won't be allowed unless they are Task<> or IObservable<> as stated in docs and exception.

Note that in Refit unlike in Retrofit, there is no option for a synchronous network request - all requests must be async, either via Task or via IObservable. There is also no option to create an async method via a Callback parameter unlike Retrofit, because we live in the async/await future.

What might this PR break? If anyone created an interface with a wrong generic return value their generation will fail now

Please check if the PR fulfills these requirements

  • [x] Tests for the changes have been added (for bug fixes / features)

barchkile avatar May 23 '22 06:05 barchkile

CLA assistant check
All CLA requirements met.

dnfadmin avatar May 23 '22 06:05 dnfadmin

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

github-actions[bot] avatar Apr 28 '23 00:04 github-actions[bot]