Scalar.Net
1.0.3
dotnet add package Scalar.Net --version 1.0.3
NuGet\Install-Package Scalar.Net -Version 1.0.3
<PackageReference Include="Scalar.Net" Version="1.0.3" />
<PackageVersion Include="Scalar.Net" Version="1.0.3" />
<PackageReference Include="Scalar.Net" />
paket add Scalar.Net --version 1.0.3
#r "nuget: Scalar.Net, 1.0.3"
#:package Scalar.Net@1.0.3
#addin nuget:?package=Scalar.Net&version=1.0.3
#tool nuget:?package=Scalar.Net&version=1.0.3
Scalar.Net
This project is a simple middleware that will expose Scalar documentation for your .NET API on the route which you want for your Swagger/OpenApi
specs.
Installation
You can install this easily from Nuget on the following location:
Usage
After installation you'll need to alter your startup and add Scalar
to the services. You can to this by calling next method:
//map configuration to scalar options
builder.Services.AddScalar(opts => builder.Configuration.GetSection("Scalar").Bind(opts));
//or manually set them
builder.Services.AddScalar(opts =>
{
opts.Theme = ScalarLayoutType.Modern;
});
Available configuration options are located here. And they closely mimic the configuration on the related node packages over on original Scalar repository. You can find original configuration on this link.
After configuring options be sure to also include Scalar middlware in your pipeline in order to show the documentation. You can do this by simply calling next method:
//map scalar endpoint wherever you want
app.Map("/docs", a =>
{
a.UseScalar();
});
And that is it. Simply visit the related endpoint and you should see your spec generate the related documentation and run the Scalar app in browser.
Examples
Examples directory contains a sample project which has swagger and scalar integrated so you can more closely follow how to set this up. Few images of this can be found below:
Documentation page:
Documentation request editor:
License
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 was computed. 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. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net8.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.