Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Refit.Benchmarks/Refit.Benchmarks.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFrameworks>net8.0</TargetFrameworks>
<TargetFrameworks>net8.0;net9.0</TargetFrameworks>
<IsPackable>false</IsPackable>
<NoWarn>$(NoWarn);CS1591</NoWarn>
</PropertyGroup>
Expand Down
12 changes: 2 additions & 10 deletions Refit/ApiResponse.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,12 @@
internal static T Create<T, TBody>(
HttpRequestMessage request,
HttpResponseMessage? resp,
object? content,
TBody? content,
RefitSettings settings,
ApiExceptionBase? error = null
)
{
return (T)
Activator.CreateInstance(
typeof(ApiResponse<TBody>),
request,
resp,
content,
settings,
error
)!;
return (T)(object)new ApiResponse<TBody>(request, resp, content, settings, error);
}
}

Expand Down Expand Up @@ -210,7 +202,7 @@
#endif
out ApiRequestException error)
{
error = Error as ApiRequestException;

Check warning on line 205 in Refit/ApiResponse.cs

View workflow job for this annotation

GitHub Actions / build / build-unix (macos-latest)

Possible null reference assignment.

Check warning on line 205 in Refit/ApiResponse.cs

View workflow job for this annotation

GitHub Actions / build / build-windows

Possible null reference assignment.

Check warning on line 205 in Refit/ApiResponse.cs

View workflow job for this annotation

GitHub Actions / build / build-unix (ubuntu-latest)

Possible null reference assignment.
return error != null;
}

Expand All @@ -226,7 +218,7 @@
#endif
out ApiException error)
{
error = Error as ApiException;

Check warning on line 221 in Refit/ApiResponse.cs

View workflow job for this annotation

GitHub Actions / build / build-unix (macos-latest)

Possible null reference assignment.

Check warning on line 221 in Refit/ApiResponse.cs

View workflow job for this annotation

GitHub Actions / build / build-unix (ubuntu-latest)

Possible null reference assignment.
return error != null;
}

Expand All @@ -248,7 +240,7 @@
.Create(
request,
request.Method,
response,

Check warning on line 243 in Refit/ApiResponse.cs

View workflow job for this annotation

GitHub Actions / build / build-unix (macos-latest)

Possible null reference argument for parameter 'response' in 'Task<ApiException> ApiException.Create(HttpRequestMessage message, HttpMethod httpMethod, HttpResponseMessage response, RefitSettings refitSettings, Exception? innerException = null)'.

Check warning on line 243 in Refit/ApiResponse.cs

View workflow job for this annotation

GitHub Actions / build / build-unix (ubuntu-latest)

Possible null reference argument for parameter 'response' in 'Task<ApiException> ApiException.Create(HttpRequestMessage message, HttpMethod httpMethod, HttpResponseMessage response, RefitSettings refitSettings, Exception? innerException = null)'.
Settings
)
.ConfigureAwait(false);
Expand Down
2 changes: 1 addition & 1 deletion Refit/RequestBuilderImplementation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,7 @@ object itemValue
return ApiResponse.Create<T, TBody>(
rq,
resp,
null,
default,
settings,
new ApiRequestException(rq, rq.Method, settings, ex)
);
Expand Down
Loading