• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

loresoft / FluentRest / 10305144690

08 Aug 2024 03:36PM UTC coverage: 59.221% (+2.5%) from 56.682%
10305144690

push

github

pwelter34
fix ProblemDetail Deserialize, add a QueryString IEnumerable overload

282 of 610 branches covered (46.23%)

Branch coverage included in aggregate %.

10 of 22 new or added lines in 3 files covered. (45.45%)

858 of 1315 relevant lines covered (65.25%)

75.53 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

71.43
/src/FluentRest/ProblemDetails.cs
1
using System.Text.Json.Serialization;
2

3
#nullable enable
4

5
namespace FluentRest;
6

7
/// <summary>
8
/// A machine-readable format for specifying errors in HTTP API responses based on https://tools.ietf.org/html/rfc7807.
9
/// </summary>
10
public class ProblemDetails
11
{
12
    /// <summary>
13
    /// The content-type for a problem json response
14
    /// </summary>
15
    public const string ContentType = "application/problem+json";
16

17
    /// <summary>
18
    /// A URI reference [RFC3986] that identifies the problem type. This specification encourages that, when
19
    /// dereferenced, it provide human-readable documentation for the problem type
20
    /// (e.g., using HTML [W3C.REC-html5-20141028]). When this member is not present, its value is assumed to be
21
    /// "about:blank".
22
    /// </summary>
23
    [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
24
    [JsonPropertyOrder(-5)]
25
    [JsonPropertyName("type")]
26
    public string? Type { get; set; }
9✔
27

28
    /// <summary>
29
    /// A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence
30
    /// of the problem, except for purposes of localization(e.g., using proactive content negotiation;
31
    /// see[RFC7231], Section 3.4).
32
    /// </summary>
33
    [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
34
    [JsonPropertyOrder(-4)]
35
    [JsonPropertyName("title")]
36
    public string? Title { get; set; }
18✔
37

38
    /// <summary>
39
    /// The HTTP status code([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.
40
    /// </summary>
41
    [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
42
    [JsonPropertyOrder(-3)]
43
    [JsonPropertyName("status")]
44
    public int? Status { get; set; }
18✔
45

46
    /// <summary>
47
    /// A human-readable explanation specific to this occurrence of the problem.
48
    /// </summary>
49
    [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
50
    [JsonPropertyOrder(-2)]
51
    [JsonPropertyName("detail")]
NEW
52
    public string? Detail { get; set; }
×
53

54
    /// <summary>
55
    /// A URI reference that identifies the specific occurrence of the problem. It may or may not yield further information if dereferenced.
56
    /// </summary>
57
    [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
58
    [JsonPropertyOrder(-1)]
59
    [JsonPropertyName("instance")]
NEW
60
    public string? Instance { get; set; }
×
61

62
    /// <summary>
63
    /// Gets the validation errors associated with this instance of problem details
64
    /// </summary>
65
    [JsonPropertyName("errors")]
66
    public IDictionary<string, string[]> Errors { get; set; } = new Dictionary<string, string[]>(StringComparer.Ordinal);
12✔
67

68
    /// <summary>
69
    /// Gets the <see cref="IDictionary{TKey, TValue}"/> for extension members.
70
    /// <para>
71
    /// Problem type definitions MAY extend the problem details object with additional members. Extension members appear in the same namespace as
72
    /// other members of a problem type.
73
    /// </para>
74
    /// </summary>
75
    /// <remarks>
76
    /// The round-tripping behavior for <see cref="Extensions"/> is determined by the implementation of the Input \ Output formatters.
77
    /// In particular, complex types or collection types may not round-trip to the original type when using the built-in JSON or XML formatters.
78
    /// </remarks>
79
    [JsonExtensionData]
80
    public IDictionary<string, object?> Extensions { get; set; } = new Dictionary<string, object?>(StringComparer.Ordinal);
33✔
81
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc