WebApiDocumentator 1.0.2

There is a newer version of this package available.
See the version list below for details.
dotnet add package WebApiDocumentator --version 1.0.2
                    
NuGet\Install-Package WebApiDocumentator -Version 1.0.2
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="WebApiDocumentator" Version="1.0.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="WebApiDocumentator" Version="1.0.2" />
                    
Directory.Packages.props
<PackageReference Include="WebApiDocumentator" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add WebApiDocumentator --version 1.0.2
                    
#r "nuget: WebApiDocumentator, 1.0.2"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#addin nuget:?package=WebApiDocumentator&version=1.0.2
                    
Install WebApiDocumentator as a Cake Addin
#tool nuget:?package=WebApiDocumentator&version=1.0.2
                    
Install WebApiDocumentator as a Cake Tool

Nuget Nuget

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

  1. Install the nuget package via the package manager:

    dotnet add package WebApiDocumentator
    
  2. 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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.5 10 6/4/2025
1.0.4 52 6/1/2025
1.0.3 131 5/29/2025
1.0.2 132 5/28/2025
1.0.1 133 5/27/2025
1.0.0 142 5/26/2025

Improve response information with status code. Change how to show the services parameters.