An extension to add Swagger, OpenApi, Scalar, CustomUrl and CustomRoute to .Net Aspire dashboard for API, Blazor and any other app. You can have ApiDocs and also your custom links in your .Net Aspire Dashboard like this :
Simply install this nuget package Arshid.Aspire.ApiDocs.Extensions to your AppHost.csproj
dotnet add package Arshid.Aspire.ApiDocs.Extensions
Then add these lines for the project that has Swagger, Scalar or etc.
using Arshid.Aspire.ApiDocs.Extensions;
var apiService = builder.AddProject<Projects.AspireApp1_ApiService>("apiservice")
.WithScalar()
.WithSwagger()
.WithOpenApi()
.WithCustomUrl("https://127.0.0.1:5000/CustomRoute/CustomPage1")
.WithRoute("/CustomRoute/CustomPage2");| Method | Description | Parameters |
|---|---|---|
WithSwagger() |
Adds Swagger UI link | IsHttps (optional): Use HTTPS endpoint |
WithScalar() |
Adds Scalar docs link | IsHttps (optional): Use HTTPS endpoint |
WithOpenApi() |
Adds OpenAPI JSON link | IsHttps (optional): Use HTTPS endpoint |
WithCustomUrl() |
Adds custom external URL | CustomUrl: Full URL to open |
WithRoute() |
Adds custom route link | CustomRoute: Route path (e.g., /health) |
builder.AddProject<Projects.MyApi>("api")
.WithSwagger(IsHttps: true)
.WithScalar(IsHttps: true);dotnet test| Metric | Value |
|---|---|
| Package | Arshid.Aspire.ApiDocs.Extensions |
| Latest version | 13.1.0.1 |
| Total downloads | ~4,5K |
| Average daily downloads | ~12 |
| More stats | NuGet page |
If you are not familiar with Swagger, Scalar, OpenApi and similar tools please read from this article :
net-9-revolutionizing-documentation-of-apis-from-swashbuckle-to-scalar
- .NET 10.0+ (for older .NET versions install other versions of this package)
- .NET Aspire 13.x If your project targets earlier versions, please consider using a previous release of this package.
Contributions are welcome! Feel free to open a Pull Request.


