Scalar.AspNetCore 2.1.0
Scalar .NET API Reference Integration
This .NET package Scalar.AspNetCore
provides an easy way to render beautiful API references based on OpenAPI/Swagger documents.
Made possible by the wonderful work of @captainsafia on building the integration and docs written for the Scalar & .NET integration. Thanks to @xC0dex for making it awesome.
Features
- Stunning API Reference
- Compatible with .NET 8 and above
- Independent of OpenAPI document generators
- Fully AOT (Ahead-of-Time) compatible
Migration Guide
If you are upgrading from 1.x.x
to 2.x.x
, please refer to the migration guide.
Usage
- Install the package
dotnet add package Scalar.AspNetCore --version 2.1.*
[!NOTE] We release new versions frequently to bring you the latest features and bug fixes. To reduce the noise in your project file, we recommend using a wildcard for the patch version, e.g.,
2.1.*
.
- Add the using directive
using Scalar.AspNetCore;
- Configure your application
Add the following to Program.cs
based on your OpenAPI generator:
For Microsoft.AspNetCore.OpenApi
:
builder.Services.AddOpenApi();
if (app.Environment.IsDevelopment())
{
app.MapOpenApi();
app.MapScalarApiReference();
}
For Swashbuckle
:
builder.Services.AddEndpointsApiExplorer();
builder.Services.AddSwaggerGen();
if (app.Environment.IsDevelopment())
{
app.UseSwagger(options =>
{
options.RouteTemplate = "/openapi/{documentName}.json";
});
app.MapScalarApiReference();
}
For NSwag
:
builder.Services.AddEndpointsApiExplorer();
builder.Services.AddOpenApiDocument();
if (app.Environment.IsDevelopment())
{
app.UseOpenApi(options =>
{
options.Path = "/openapi/{documentName}.json";
});
app.MapScalarApiReference();
}
That's it! 🎉 You can now access the Scalar API Reference at /scalar
. By default, the API Reference uses the v1
document. You can add documents by calling the AddDocument
method. Alternatively, you can navigate to /scalar/{documentName}
(e.g., /scalar/v1
) to view the API Reference for a specific document. Please check out the dotnet integration documentation for more details.
Configuration
For detailed configuration options, refer to the integration documentation. This documentation focuses on the features provided by the package.
For more realistic examples and advanced usage scenarios, such as authentication, API versioning, and handling multiple documents, check out our extended examples documentation. This documentation is also useful if you need more context on what Scalar.AspNetCore
is for.
Development
Local
- Download .NET 9.0
- Jump to the package folder:
cd integrations/aspnetcore
- Do a fresh build:
dotnet build
- Run the tests:
dotnet test
And see it in action here:
- Switch to the playground:
cd playground/Scalar.AspNetCore.Playground
- Start the playground:
dotnet run
- Open this URL in the browser: http://localhost:5056/scalar/
Docker
If you don't have the SDK installed or want to run the playground under a subpath, you can use Docker Compose:
- Run Docker Compose:
docker compose up --build
- Open this URL in the browser: http://localhost:8080/api/scalar/
Community
We are API nerds. You too? Let’s chat on Discord: https://discord.gg/scalar
License
The source code in this repository is licensed under MIT.
No packages depend on Scalar.AspNetCore.
.NET 8.0
- No dependencies.
.NET 9.0
- No dependencies.
Version | Downloads | Last updated |
---|---|---|
2.5.3 | 2 | 06/27/2025 |
2.5.1 | 2 | 06/26/2025 |
2.5.0 | 2 | 06/24/2025 |
2.4.22 | 3 | 06/20/2025 |
2.4.21 | 3 | 06/20/2025 |
2.4.20 | 3 | 06/20/2025 |
2.4.19 | 3 | 06/20/2025 |
2.4.18 | 2 | 06/20/2025 |
2.4.17 | 2 | 06/20/2025 |
2.4.16 | 2 | 06/20/2025 |
2.4.15 | 3 | 06/20/2025 |
2.4.14 | 3 | 06/20/2025 |
2.4.13 | 3 | 06/09/2025 |
2.4.12 | 5 | 06/09/2025 |
2.4.11 | 4 | 06/09/2025 |
2.4.9 | 3 | 06/09/2025 |
2.4.8 | 6 | 06/04/2025 |
2.4.7 | 6 | 05/31/2025 |
2.4.6 | 6 | 06/01/2025 |
2.4.5 | 6 | 06/01/2025 |
2.4.4 | 4 | 05/29/2025 |
2.4.3 | 5 | 05/29/2025 |
2.4.2 | 6 | 05/29/2025 |
2.4.1 | 5 | 05/29/2025 |
2.3.1 | 5 | 05/29/2025 |
2.3.0 | 6 | 05/29/2025 |
2.2.7 | 5 | 05/29/2025 |
2.2.5 | 5 | 05/29/2025 |
2.2.4 | 6 | 05/29/2025 |
2.2.3 | 5 | 05/29/2025 |
2.2.2 | 5 | 05/29/2025 |
2.2.1 | 5 | 05/29/2025 |
2.2.0 | 6 | 05/29/2025 |
2.1.18 | 5 | 05/29/2025 |
2.1.17 | 6 | 05/29/2025 |
2.1.16 | 4 | 05/29/2025 |
2.1.15 | 4 | 05/29/2025 |
2.1.14 | 5 | 05/29/2025 |
2.1.13 | 6 | 05/29/2025 |
2.1.12 | 6 | 05/29/2025 |
2.1.11 | 5 | 05/29/2025 |
2.1.10 | 5 | 05/29/2025 |
2.1.9 | 5 | 05/29/2025 |
2.1.8 | 7 | 05/29/2025 |
2.1.7 | 6 | 05/29/2025 |
2.1.6 | 6 | 05/29/2025 |
2.1.5 | 5 | 05/29/2025 |
2.1.4 | 5 | 05/29/2025 |
2.1.3 | 4 | 05/29/2025 |
2.1.2 | 4 | 05/29/2025 |
2.1.1 | 5 | 05/29/2025 |
2.1.0 | 5 | 05/29/2025 |
2.0.36 | 5 | 05/29/2025 |
2.0.34 | 5 | 05/29/2025 |
2.0.33 | 5 | 05/29/2025 |
2.0.30 | 6 | 05/29/2025 |
2.0.29 | 6 | 05/29/2025 |
2.0.28 | 4 | 05/29/2025 |
2.0.27 | 6 | 05/29/2025 |
2.0.26 | 5 | 05/29/2025 |
2.0.25 | 4 | 05/29/2025 |
2.0.24 | 5 | 05/29/2025 |
2.0.23 | 6 | 05/29/2025 |
2.0.22 | 5 | 05/29/2025 |
2.0.21 | 6 | 05/29/2025 |
2.0.20 | 6 | 05/29/2025 |
2.0.19 | 5 | 05/29/2025 |
2.0.18 | 7 | 05/29/2025 |
2.0.17 | 5 | 05/29/2025 |
2.0.16 | 5 | 05/29/2025 |
2.0.15 | 6 | 05/29/2025 |
2.0.14 | 5 | 05/29/2025 |
2.0.12 | 5 | 05/29/2025 |
2.0.11 | 6 | 05/29/2025 |
2.0.10 | 5 | 05/29/2025 |
2.0.9 | 6 | 05/29/2025 |
2.0.8 | 7 | 05/29/2025 |
2.0.7 | 5 | 05/29/2025 |
2.0.6 | 6 | 05/29/2025 |
2.0.5 | 6 | 05/29/2025 |
2.0.4 | 4 | 05/29/2025 |
2.0.2 | 4 | 05/29/2025 |
2.0.1 | 6 | 05/29/2025 |
2.0.0 | 5 | 05/29/2025 |
1.2.76 | 5 | 05/29/2025 |
1.2.75 | 5 | 05/29/2025 |
1.2.74 | 5 | 05/29/2025 |
1.2.73 | 5 | 05/29/2025 |
1.2.72 | 9 | 03/31/2025 |
1.2.71 | 5 | 05/29/2025 |
1.2.70 | 6 | 05/29/2025 |
1.2.69 | 4 | 05/29/2025 |
1.2.68 | 6 | 05/29/2025 |
1.2.67 | 6 | 05/29/2025 |
1.2.66 | 6 | 05/29/2025 |
1.2.65 | 5 | 05/29/2025 |
1.2.64 | 5 | 05/29/2025 |
1.2.63 | 4 | 05/29/2025 |
1.2.61 | 5 | 05/29/2025 |
1.2.60 | 5 | 05/29/2025 |
1.2.59 | 5 | 05/29/2025 |
1.2.58 | 5 | 05/29/2025 |
1.2.57 | 5 | 05/29/2025 |
1.2.56 | 5 | 05/29/2025 |
1.2.55 | 5 | 05/29/2025 |
1.2.54 | 4 | 05/29/2025 |
1.2.53 | 6 | 05/29/2025 |
1.2.52 | 6 | 05/29/2025 |
1.2.51 | 5 | 05/29/2025 |
1.2.50 | 3 | 05/29/2025 |
1.2.49 | 4 | 05/29/2025 |
1.2.48 | 3 | 05/29/2025 |
1.2.47 | 5 | 05/29/2025 |
1.2.46 | 5 | 05/29/2025 |
1.2.45 | 5 | 05/29/2025 |
1.2.44 | 5 | 05/29/2025 |
1.2.43 | 5 | 05/29/2025 |
1.2.42 | 6 | 05/29/2025 |
1.2.41 | 4 | 05/29/2025 |
1.2.40 | 4 | 05/29/2025 |
1.2.39 | 6 | 05/29/2025 |
1.2.38 | 6 | 05/29/2025 |
1.2.37 | 5 | 05/29/2025 |
1.2.36 | 7 | 05/29/2025 |
1.2.35 | 6 | 05/29/2025 |
1.2.34 | 5 | 05/29/2025 |
1.2.33 | 5 | 05/29/2025 |
1.2.32 | 5 | 05/29/2025 |
1.2.31 | 5 | 05/29/2025 |
1.2.30 | 4 | 05/29/2025 |
1.2.29 | 5 | 05/29/2025 |
1.2.28 | 6 | 05/29/2025 |
1.2.27 | 6 | 05/29/2025 |
1.2.26 | 4 | 05/29/2025 |
1.2.25 | 5 | 05/29/2025 |
1.2.24 | 6 | 05/29/2025 |
1.2.23 | 6 | 05/29/2025 |
1.2.22 | 7 | 05/29/2025 |
1.2.21 | 5 | 05/29/2025 |
1.2.20 | 6 | 05/29/2025 |
1.2.19 | 6 | 05/29/2025 |
1.2.18 | 6 | 05/29/2025 |
1.2.17 | 6 | 05/29/2025 |
1.2.16 | 6 | 05/29/2025 |
1.2.15 | 4 | 05/29/2025 |
1.2.14 | 6 | 05/29/2025 |
1.2.13 | 5 | 05/29/2025 |
1.2.12 | 6 | 05/29/2025 |
1.2.11 | 5 | 05/29/2025 |
1.2.10 | 5 | 05/29/2025 |
1.2.9 | 6 | 05/29/2025 |
1.2.8 | 5 | 05/29/2025 |
1.2.7 | 4 | 05/29/2025 |
1.2.6 | 5 | 05/29/2025 |
1.2.5 | 6 | 05/29/2025 |
1.2.4 | 4 | 05/29/2025 |
1.2.3 | 6 | 05/29/2025 |
1.1.2 | 4 | 05/29/2025 |
1.1.1 | 5 | 05/29/2025 |
1.0.1 | 5 | 05/29/2025 |