-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJsonApiError.cs
More file actions
58 lines (49 loc) · 1.68 KB
/
JsonApiError.cs
File metadata and controls
58 lines (49 loc) · 1.68 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
using System.Text.Json.Nodes;
using System.Text.Json.Serialization;
namespace Crews.Web.JsonApiClient;
/// <summary>
/// Represents an error in a document as defined in section 11.2 of the JSON:API specification.
/// </summary>
public record JsonApiError
{
/// <summary>
/// Gets or sets the unique identifier for this particular occurrence of the problem.
/// </summary>
[JsonPropertyName("id")]
public string? Id { get; init; }
/// <summary>
/// Gets or sets the links that provide additional information about the error.
/// </summary>
[JsonPropertyName("links")]
public JsonApiErrorLinksObject? Links { get; init; }
/// <summary>
/// Gets or sets the HTTP status code associated with the error.
/// </summary>
[JsonPropertyName("status")]
public string? Status { get; init; }
/// <summary>
/// Gets or sets the application-specific error code associated with the error.
/// </summary>
[JsonPropertyName("code")]
public string? Code { get; init; }
/// <summary>
/// Gets or sets the title of the error.
/// </summary>
[JsonPropertyName("title")]
public string? Title { get; init; }
/// <summary>
/// Gets or sets the detailed description of the error.
/// </summary>
[JsonPropertyName("detail")]
public string? Detail { get; init; }
/// <summary>
/// Gets or sets the source of the error.
/// </summary>
[JsonPropertyName("source")]
public JsonApiErrorSource? Source { get; init; }
/// <summary>
/// Gets or sets the additional metadata associated with the object.
/// </summary>
[JsonPropertyName("meta")]
public JsonObject? Meta { get; init; }
}