Skip to content

Commit b585ce7

Browse files
authored
Merge pull request #17 from sheepla/devin/1777647229-docs-improvements
Fix docs
2 parents 9771127 + 7960a01 commit b585ce7

3 files changed

Lines changed: 14 additions & 44 deletions

File tree

docs/src/content/docs/getting-started/installation.mdx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,11 @@ description: "Install AxisEndpoints and optional extension packages in your ASP.
55

66
import { LinkCard, CardGrid } from '@astrojs/starlight/components';
77

8-
## NuGet Packages (Recommended)
98

10-
<CardGrid>
11-
<LinkCard title="AxisEndpoints" href="https://www.nuget.org/packages/AxisEndpoints" description="Core package" />
12-
<LinkCard title="AxisEndpoints.Extensions.CsvHelper" href="https://www.nuget.org/packages/AxisEndpoints.Extensions.CsvHelper" description="CSV import/export extension" />
13-
</CardGrid>
149

15-
## Install from nuget.org
10+
## Install from nuget.org (Recommended)
1611

17-
Add the core package to your project:
12+
Packages are available on nuget.org. Run the following command in your project directory to install the core package:
1813

1914
```sh
2015
dotnet add package AxisEndpoints
@@ -26,6 +21,11 @@ For the CSV extension:
2621
dotnet add package AxisEndpoints.Extensions.CsvHelper
2722
```
2823

24+
<CardGrid>
25+
<LinkCard title="AxisEndpoints" href="https://www.nuget.org/packages/AxisEndpoints" description="Core package" />
26+
<LinkCard title="AxisEndpoints.Extensions.CsvHelper" href="https://www.nuget.org/packages/AxisEndpoints.Extensions.CsvHelper" description="CSV import/export extension" />
27+
</CardGrid>
28+
2929
## Install from local nupkg
3030

3131
If you are building from source or testing a pre-release version, you can install from a local `.nupkg` file:

docs/src/content/docs/getting-started/quick-start.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ import { Steps } from '@astrojs/starlight/components';
4343

4444
4. **Create your first endpoint**
4545

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.
4747

4848
```csharp
4949
public class CreateUserRequest

docs/src/content/docs/guides/core-primitives.mdx

Lines changed: 6 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -98,42 +98,6 @@ flowchart TD
9898
I --> H
9999
```
100100

101-
---
102-
103-
## Type Relationships
104-
105-
The following diagram shows how the core types relate to each other.
106-
107-
```mermaid
108-
classDiagram
109-
class IEndpoint_TRequest_TResult {
110-
+Configure(IEndpointConfiguration config)
111-
+HandleAsync(TRequest request, CancellationToken cancel) Task~TResult~
112-
}
113-
class IEndpoint_TResult {
114-
+Configure(IEndpointConfiguration config)
115-
+HandleAsync(CancellationToken cancel) Task~TResult~
116-
}
117-
class Response_TBody {
118-
+StatusCode HttpStatusCode
119-
+Headers IReadOnlyList
120-
+Body TBody
121-
}
122-
class EmptyResponse
123-
class IEndpointGroup {
124-
+Configure(IEndpointGroupConfiguration config)
125-
}
126-
class EndpointContext {
127-
+RequestHeaders IHeaderDictionary
128-
+User ClaimsPrincipal
129-
+Query IQueryCollection
130-
+GetRouteValue(key) string?
131-
+RawResponse HttpResponse
132-
}
133-
```
134-
135-
---
136-
137101
## Notes on ASP.NET Core Standard Types
138102

139103
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
142106

143107
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.
144108

109+
> [IResult - Microsoft docs](https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.http.iresult)
110+
145111
### `ProblemDetails`
146112

147113
`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.
148114

115+
> [ProblemDetails - Microsoft docs](https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.mvc.problemdetails)
116+
149117
### `IEndpointFilter`
150118

151119
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

Comments
 (0)