arch / ApiHelp

A toolchain for ASP.NET Core to automatically generate API documentation.
MIT License
12 stars 7 forks source link

Microsoft.AspNetCore.ApiHelp

A toolchain for ASP.NET Core to automatically generating API documentation.

Features

Running from demo

To integrate ApiHelp to your project, download this repo and see Host source code, running and open link api/help/ui in your browser to view the result.

Packages

How to use

Install package.

PM> Install-Package Microsoft.AspNetCore.ApiHelp

Configure Startup.cs.

public void ConfigureServices(IServiceCollection services) {
    services.AddMvc()
        .AddApiHelp(options => {
            options.IgnoreObsoleteApi = true;
            options.GenerateStrategy = DocumentGenerateStrategy.Eager;
            options.IncludeSupportedMediaType = false;
        });
}

public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory) {
    loggerFactory.AddConsole(Configuration.GetSection("Logging"));

    app.UseApiHelp(new ApiHelpUIOptions {
        Title = "API toolchain for ASP.NET Core",
        UI = ApiHelpUI.Swagger,
    });

    app.UseMvc();
}