Skip to content

Commit 36698e2

Browse files
authored
Revert Nullability of ApiCallDetails. (#84)
1 parent f14c363 commit 36698e2

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/Elastic.Transport/Responses/TransportResponse.cs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,16 @@ public abstract class TransportResponse<T> : TransportResponse
2323
/// </summary>
2424
public abstract class TransportResponse
2525
{
26-
/// <summary>
27-
///
28-
/// </summary>
26+
/// <summary> Returns details about the API call that created this response. </summary>
2927
[JsonIgnore]
30-
public ApiCallDetails? ApiCallDetails { get; internal set; }
28+
// TODO: ApiCallDetails is always set, but nothing enforces it
29+
// since we use new() generic constraint we can not enforce a protected constructor.
30+
// ReSharper disable once NotNullOrRequiredMemberIsNotInitialized
31+
public ApiCallDetails ApiCallDetails { get; internal set; }
3132

3233
/// <inheritdoc cref="object.ToString"/>
3334
public override string ToString() => ApiCallDetails?.DebugInformation
34-
?? $"{nameof(ApiCallDetails)} not set reverting to default ToString(): {base.ToString()}";
35+
// ReSharper disable once ConstantNullCoalescingCondition
36+
?? $"{nameof(ApiCallDetails)} not set, likely a bug, reverting to default ToString(): {base.ToString()}";
3537
}
3638

0 commit comments

Comments
 (0)