WebApiDocumentator 1.0.2
See the version list below for details.
dotnet add package WebApiDocumentator --version 1.0.2
NuGet\Install-Package WebApiDocumentator -Version 1.0.2
<PackageReference Include="WebApiDocumentator" Version="1.0.2" />
<PackageVersion Include="WebApiDocumentator" Version="1.0.2" />
<PackageReference Include="WebApiDocumentator" />
paket add WebApiDocumentator --version 1.0.2
#r "nuget: WebApiDocumentator, 1.0.2"
#addin nuget:?package=WebApiDocumentator&version=1.0.2
#tool nuget:?package=WebApiDocumentator&version=1.0.2
WebApiDocumentator
WebApiDocumentator
is a quick and easy way to create an interface to document a WebAPI built in .NET Core. It creates a user-friendly interface and has options for endpoint testing.
Features
- Automatic documentation using XML metadata from C# code
- Show endpoints tree estructure
- HTML interface
- Test endpoints
Installation
Install the nuget package via the package manager:
dotnet add package WebApiDocumentator
Or by using the NuGet CLI:
nuget install WebApiDocumentator
Quick Start
Step 1: Add WebApiDocumentator to Your API
In your Program.cs
, you will need to add the middleware to your service collection and configure the options.
1.1 Configure Options
You can customize the url for the page and add basic data via DocumentatorOptions
.
In appsettings json using IOptions<DocumentatorOptions>
file like:
"DocumentatorOptions": {
"ApiName": "Your api name",
"Version": "Your version, it's a string",
"Description": "Full descripcion about your API",
"DocsBaseUrl": "documentation path, defatul it's [api root]/WebApiDocumentator"
}
Or directly like:
public void ConfigureServices(IServiceCollection services)
{
services.AddWebApiDocumentator(options =>
{
options.ApiName = "Test Api";
options.Version = "v1";
options.Description = "The best API in the world!";
options.DocsBaseUrl = "docs/api"
});
}
//minimal api
builder.Services.AddWebApiDocumentator();
//Or also can do to read the appsettings.json
/*
builder.Services.AddWebApiDocumentator(
options => builder.Configuration.GetSection(SmartCacheOptions.SectionKey).Bind(options)
);
*/
1.2 Add the user interface
In your Configure
method, add the middleware to the pipeline using UseWebApiDocumentator()
:
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
// Add other middlewares like routing, authentication, etc.
app.UseWebApiDocumentator();
}
//minimal api
app.UseWebApiDocumentator();
Step 2: Interface HTML
To access to the interface you can use the default url
[your api url]/WebApiDocumentator
Or if you personalize the url then use your own url
[your api url]/docs/api
Remind: Always you can use a defatult WebApiDocumentator page.
2.1 Home page
- Show the name, version and description from your options.
- Show the schema of your API
- Right side bar with to search and select endpoint
2.2 Selected endpoint
- Show documentation information
- Show params type and from where
- Show testing tab
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 is compatible. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. 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. 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. |
-
net6.0
- Microsoft.AspNetCore.Http.Abstractions (>= 2.3.0)
- Microsoft.Extensions.Configuration.Xml (>= 6.0.1)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 6.0.0)
- Microsoft.Extensions.Options (>= 6.0.1)
-
net7.0
- Microsoft.AspNetCore.Http.Abstractions (>= 2.3.0)
- Microsoft.Extensions.Configuration.Xml (>= 7.0.0)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 7.0.0)
- Microsoft.Extensions.Options (>= 7.0.1)
-
net8.0
- Microsoft.AspNetCore.Http.Abstractions (>= 2.3.0)
- Microsoft.Extensions.Configuration.Xml (>= 8.0.1)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 8.0.2)
- Microsoft.Extensions.Options (>= 8.0.2)
-
net9.0
- Microsoft.AspNetCore.Http.Abstractions (>= 2.3.0)
- Microsoft.Extensions.Configuration.Xml (>= 9.0.5)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 9.0.5)
- Microsoft.Extensions.Options (>= 9.0.5)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Improve response information with status code. Change how to show the services parameters.