Skip to content

Commit

Permalink
Revert Nullability of ApiCallDetails. (#84)
Browse files Browse the repository at this point in the history
  • Loading branch information
Mpdreamz authored Jun 29, 2023
1 parent f14c363 commit 36698e2
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/Elastic.Transport/Responses/TransportResponse.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,16 @@ public abstract class TransportResponse<T> : TransportResponse
/// </summary>
public abstract class TransportResponse
{
/// <summary>
///
/// </summary>
/// <summary> Returns details about the API call that created this response. </summary>
[JsonIgnore]
public ApiCallDetails? ApiCallDetails { get; internal set; }
// TODO: ApiCallDetails is always set, but nothing enforces it
// since we use new() generic constraint we can not enforce a protected constructor.
// ReSharper disable once NotNullOrRequiredMemberIsNotInitialized
public ApiCallDetails ApiCallDetails { get; internal set; }

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

0 comments on commit 36698e2

Please sign in to comment.