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

Issue 1671: Add MemberNotNullWhen attribute for Content property in IApiResponse<T> #1672

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

sguryev
Copy link

@sguryev sguryev commented Feb 22, 2024

Potential fix for #1671

An alternative way:
new bool IsSuccessStatusCode { get; } property in the IApiResponse<T> interface with all 3 attributes above

@HavenDV
Copy link

HavenDV commented Feb 22, 2024

This is similar to Breaking Change because IApiResponse<out T> is no longer IApiResponse and this may affect those using such a cast.

I suggest doing this via virtual, like here - https://stackoverflow.com/questions/72232151/membernotnullwhen-or-other-code-analysis-attributes-for-inherited-members

For some reason I was sure that it was possible to use virtual. Ok, then we should consider using new, but this can also cause some problems

@sguryev
Copy link
Author

sguryev commented May 24, 2024

@ChrisPulman oopsie, I'm sorry. I have forgotten to add IApiResponse interface to the ApiResponse<T> class.

Added here: https://github.com/reactiveui/refit/pull/1672/files#diff-092434a9c47d4491a15166652006ca2e0263b01b63c2029aa8653e165bfa543bR32

All tests are green now locally
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants