Scalar.AspNetCore
2.0.2
See the version list below for details.
dotnet add package Scalar.AspNetCore --version 2.0.2
NuGet\Install-Package Scalar.AspNetCore -Version 2.0.2
<PackageReference Include="Scalar.AspNetCore" Version="2.0.2" />
paket add Scalar.AspNetCore --version 2.0.2
#r "nuget: Scalar.AspNetCore, 2.0.2"
// Install Scalar.AspNetCore as a Cake Addin #addin nuget:?package=Scalar.AspNetCore&version=2.0.2 // Install Scalar.AspNetCore as a Cake Tool #tool nuget:?package=Scalar.AspNetCore&version=2.0.2
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.
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.0.*
[!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.0.*
.
- Add the using directive
using Scalar.AspNetCore;
- Configure your application
Add the following to Program.cs
based on your OpenAPI generator:
For .NET 9 using Microsoft.AspNetCore.OpenApi
:
builder.Services.AddOpenApi();
if (app.Environment.IsDevelopment())
{
app.MapOpenApi();
app.MapScalarApiReference();
}
For .NET 8 using Swashbuckle
:
builder.Services.AddEndpointsApiExplorer();
builder.Services.AddSwaggerGen();
if (app.Environment.IsDevelopment())
{
app.UseSwagger(options =>
{
options.RouteTemplate = "/openapi/{documentName}.json";
});
app.MapScalarApiReference();
}
For .NET 8 using NSwag
:
builder.Services.AddEndpointsApiExplorer();
builder.Services.AddOpenApiDocument();
if (app.Environment.IsDevelopment())
{
app.UseOpenApi(options =>
{
options.Path = "/openapi/{documentName}.json";
});
app.MapScalarApiReference();
}
That’s it! 🎉 With the default settings, you can now access the Scalar API reference at /scalar
to see the API reference for the v1
document. Alternatively, you can navigate to /scalar/{documentName}
(e.g., /scalar/v2
) to view the API reference for a specific document.
Configuration
For a full configuration guide and examples, including OAuth integration and custom settings, refer to the dotnet integration documentation.
Development
Local
- Download .NET 9.0
- Jump to the package folder:
cd packages/scalar.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.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. |
-
net8.0
- No dependencies.
-
net9.0
- No dependencies.
NuGet packages (28)
Showing the top 5 NuGet packages that depend on Scalar.AspNetCore:
Package | Downloads |
---|---|
Rystem.Api.Server
Rystem.Api helps you to integrate Api Server and Automated Client for Aspect-Oriented programming. |
|
devprime.stack.web
DevPrime Web |
|
ShayganTadbir.Framework.Core
Package description |
|
Milochau.Core.Aws.Integration
Milochau.Core.Aws.Integration contains integration tests helpers as part of the Milochau.Core.Aws framework for applications. |
|
Corner49.Infra
An opinionated set of infrastructure libraries for .Net applications |
GitHub repositories (30)
Showing the top 5 popular GitHub repositories that depend on Scalar.AspNetCore:
Repository | Stars |
---|---|
dotnet/AspNetCore.Docs
Documentation for ASP.NET Core
|
|
dotnet/eShop
A reference .NET application implementing an eCommerce site
|
|
davidfowl/TodoApp
Todo application with ASP.NET Core Blazor WASM, Minimal APIs and Authentication
|
|
grandnode/grandnode2
Open-Source eCommerce Platform on .NET Core, MongoDB, AWS DocumentDB, Azure CosmosDB, LiteDB & Vue.js
|
|
GZTimeWalker/GZCTF
The GZ::CTF project, an open source CTF platform.
|
Version | Downloads | Last updated |
---|---|---|
2.0.12 | 8,896 | 6 days ago |
2.0.11 | 6,142 | 8 days ago |
2.0.10 | 885 | 8 days ago |
2.0.9 | 15,098 | 13 days ago |
2.0.8 | 588 | 13 days ago |
2.0.7 | 6,821 | 15 days ago |
2.0.6 | 542 | 15 days ago |
2.0.5 | 3,785 | 16 days ago |
2.0.4 | 13,235 | 21 days ago |
2.0.2 | 9,428 | 23 days ago |
2.0.1 | 12,710 | a month ago |
2.0.0 | 2,592 | a month ago |
1.2.76 | 23,800 | a month ago |
1.2.75 | 6,478 | a month ago |
1.2.74 | 16,449 | a month ago |
1.2.73 | 3,392 | a month ago |
1.2.72 | 33,402 | 2 months ago |
1.2.71 | 3,168 | 2 months ago |
1.2.70 | 4,987 | 2 months ago |
1.2.69 | 1,147 | 2 months ago |
1.2.68 | 1,615 | 2 months ago |
1.2.67 | 512 | 2 months ago |
1.2.66 | 3,463 | 2 months ago |
1.2.65 | 438 | 2 months ago |
1.2.64 | 7,643 | 2 months ago |
1.2.63 | 4,115 | 2 months ago |
1.2.61 | 2,812 | 2 months ago |
1.2.60 | 1,690 | 2 months ago |
1.2.59 | 313 | 2 months ago |
1.2.58 | 188 | 2 months ago |
1.2.57 | 996 | 2 months ago |
1.2.56 | 8,373 | 2 months ago |
1.2.55 | 4,272 | 2 months ago |
1.2.54 | 241 | 2 months ago |
1.2.53 | 8,599 | 2 months ago |
1.2.52 | 850 | 2 months ago |
1.2.51 | 10,042 | 2 months ago |
1.2.50 | 4,704 | 2 months ago |
1.2.49 | 11,045 | 2 months ago |
1.2.48 | 4,476 | 2 months ago |
1.2.47 | 5,534 | 2 months ago |
1.2.46 | 860 | 2 months ago |
1.2.45 | 67,731 | 3 months ago |
1.2.44 | 22,211 | 3 months ago |
1.2.43 | 1,127 | 3 months ago |
1.2.42 | 11,183 | 3 months ago |
1.2.41 | 15,625 | 3 months ago |
1.2.40 | 732 | 3 months ago |
1.2.39 | 12,427 | 3 months ago |
1.2.38 | 289 | 3 months ago |
1.2.37 | 8,727 | 3 months ago |
1.2.36 | 13,244 | 3 months ago |
1.2.35 | 2,211 | 3 months ago |
1.2.34 | 12,040 | 3 months ago |
1.2.33 | 2,422 | 3 months ago |
1.2.32 | 299 | 3 months ago |
1.2.31 | 3,822 | 3 months ago |
1.2.30 | 2,094 | 3 months ago |
1.2.29 | 4,831 | 3 months ago |
1.2.28 | 988 | 3 months ago |
1.2.27 | 6,098 | 3 months ago |
1.2.26 | 2,893 | 3 months ago |
1.2.25 | 2,466 | 3 months ago |
1.2.24 | 1,273 | 3 months ago |
1.2.23 | 4,924 | 4 months ago |
1.2.22 | 3,325 | 4 months ago |
1.2.21 | 3,227 | 4 months ago |
1.2.20 | 640 | 4 months ago |
1.2.19 | 122 | 4 months ago |
1.2.18 | 5,014 | 4 months ago |
1.2.17 | 442 | 4 months ago |
1.2.16 | 669 | 4 months ago |
1.2.15 | 535 | 4 months ago |
1.2.14 | 232 | 4 months ago |
1.2.13 | 213 | 4 months ago |
1.2.12 | 888 | 4 months ago |
1.2.11 | 234 | 4 months ago |
1.2.10 | 3,263 | 4 months ago |
1.2.9 | 14,814 | 4 months ago |
1.2.8 | 513 | 4 months ago |
1.2.7 | 678 | 4 months ago |
1.2.6 | 240 | 4 months ago |
1.2.5 | 1,428 | 4 months ago |
1.2.4 | 3,275 | 5 months ago |
1.2.3 | 6,277 | 5 months ago |
1.1.2 | 11,147 | 7 months ago |
1.1.1 | 4,971 | 9 months ago |
1.0.1 | 598 | 9 months ago |