Skip to content
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

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

Merged
merged 6 commits into from
Apr 13, 2023

Conversation

barchkile
Copy link
Contributor

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

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

@dnfadmin
Copy link

dnfadmin commented May 23, 2022

CLA assistant check
All CLA requirements met.

@glennawatson glennawatson merged commit c8888e1 into reactiveui:main Apr 13, 2023
@github-actions
Copy link

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 github-actions bot locked as resolved and limited conversation to collaborators Apr 28, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants