You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/src/content/docs/getting-started/quick-start.mdx
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -43,7 +43,7 @@ import { Steps } from '@astrojs/starlight/components';
43
43
44
44
4.**Create your first endpoint**
45
45
46
-
Here is an example of a POST endpoint that creates a user and returns a JSON response:
46
+
Create a new class `CreateUserEndpoint` that implements `IEndpoint<CreateUserRequest, Response<CreateUserResponse>>` at `CreateUserEndpoint.cs`. This endpoint will handle POST requests to create a new user.
AxisEndpoints builds directly on ASP.NET Core standard types. The types below are not AxisEndpoints-specific, so standard Minimal API knowledge applies as-is.
@@ -142,10 +106,16 @@ AxisEndpoints builds directly on ASP.NET Core standard types. The types below ar
142
106
143
107
This interface is provided by ASP.NET Core Minimal APIs and represents an HTTP response. It is produced by factory methods such as `Results.Json()`, `Results.Problem()`, `Results.Ok()`, and `Results.NotFound()`. In AxisEndpoints, specifying `IResult` as the return type of `HandleAsync` lets you return different response shapes based on the outcome, such as JSON on success and `ProblemDetails` on error.
144
108
109
+
> [IResult - Microsoft docs](https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.http.iresult)
110
+
145
111
### `ProblemDetails`
146
112
147
113
`Microsoft.AspNetCore.Mvc.ProblemDetails` provides the standard error response format defined by RFC 9457 (formerly RFC 7807). It includes fields such as `type`, `title`, `status`, `detail`, and `errors`, which bring consistency to API error responses. AxisEndpoints' DataAnnotations validation filter also returns validation errors in this format.
148
114
115
+
> [ProblemDetails - Microsoft docs](https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.mvc.problemdetails)
116
+
149
117
### `IEndpointFilter`
150
118
151
119
This filter interface is provided by ASP.NET Core Minimal APIs and lets you insert logic into the request pipeline. Unlike middleware, it can be scoped to specific endpoints or groups, which gives you finer control over cross-cutting concerns.
120
+
121
+
> [IEndpointFilter - Microsoft docs](https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.http.iendpointfilter)
0 commit comments