Skip to content

Commit b7d77ea

Browse files
committed
Document JsonApiEndpoints enum (#1298)
1 parent 952518a commit b7d77ea

File tree

1 file changed

+62
-0
lines changed

1 file changed

+62
-0
lines changed

src/JsonApiDotNetCore.Annotations/Controllers/JsonApiEndpoints.shared.cs

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,81 @@ namespace JsonApiDotNetCore.Controllers;
1111
public enum JsonApiEndpoints
1212
{
1313
None = 0,
14+
15+
/// <summary>
16+
/// Endpoint to get a collection of primary resources.
17+
/// </summary>
18+
/// <example><code><![CDATA[GET /articles]]></code></example>
1419
GetCollection = 1,
20+
21+
/// <summary>
22+
/// Endpoint to get a single primary resource by ID.
23+
/// </summary>
24+
/// <example><code><![CDATA[GET /articles/1]]></code></example>
1525
GetSingle = 1 << 1,
26+
27+
/// <summary>
28+
/// Endpoint to get a secondary resource or collection of secondary resources.
29+
/// </summary>
30+
/// <example><code><![CDATA[GET /articles/1/author]]></code></example>
1631
GetSecondary = 1 << 2,
32+
33+
/// <summary>
34+
/// Endpoint to get a relationship value, which can be a <c>null</c>, a single object or a collection.
35+
/// </summary>
36+
/// <example><code><![CDATA[GET /articles/1/relationships/author]]></code></example>
37+
/// <example><code><![CDATA[GET /articles/1/relationships/revisions]]></code></example>
1738
GetRelationship = 1 << 3,
39+
40+
/// <summary>
41+
/// Endpoint to creates a new resource with attributes, relationships or both.
42+
/// </summary>
43+
/// <example><code><![CDATA[POST /articles]]></code></example>
1844
Post = 1 << 4,
45+
46+
/// <summary>
47+
/// Endpoint to add resources to a to-many relationship.
48+
/// </summary>
49+
/// <example><code><![CDATA[POST /articles/1/revisions]]></code></example>
1950
PostRelationship = 1 << 5,
51+
52+
/// <summary>
53+
/// Endpoint to update the attributes and/or relationships of an existing resource.
54+
/// </summary>
55+
/// <example><code><![CDATA[PATCH /articles/1]]></code></example>
2056
Patch = 1 << 6,
57+
58+
/// <summary>
59+
/// Endpoint to perform a complete replacement of a relationship on an existing resource.
60+
/// </summary>
61+
/// <example><code><![CDATA[PATCH /articles/1/relationships/author]]></code></example>
62+
/// <example><code><![CDATA[PATCH /articles/1/relationships/revisions]]></code></example>
2163
PatchRelationship = 1 << 7,
64+
65+
/// <summary>
66+
/// Endpoint to delete an existing resource.
67+
/// </summary>
68+
/// <example><code><![CDATA[DELETE /articles/1]]></code></example>
2269
Delete = 1 << 8,
70+
71+
/// <summary>
72+
/// Endpoint to remove resources from a to-many relationship.
73+
/// </summary>
74+
/// <example><code><![CDATA[DELETE /articles/1/relationships/revisions]]></code></example>
2375
DeleteRelationship = 1 << 9,
2476

77+
/// <summary>
78+
/// All read-only endpoints.
79+
/// </summary>
2580
Query = GetCollection | GetSingle | GetSecondary | GetRelationship,
81+
82+
/// <summary>
83+
/// All write endpoints.
84+
/// </summary>
2685
Command = Post | PostRelationship | Patch | PatchRelationship | Delete | DeleteRelationship,
2786

87+
/// <summary>
88+
/// All endpoints.
89+
/// </summary>
2890
All = Query | Command
2991
}

0 commit comments

Comments
 (0)