Skip to content
Documentation

WebApplicationExtension Class

Provides extension methods for adding automatically generated OpenAPI documentation to an MVC framework based HTTP API.

public static class WebApplicationExtension

Inheritance System.Object 🡒 WebApplicationExtension

WebApplicationExtension.UseDocumentation(this WebApplication, Action<SwaggerOptions>) Method

Section titled “WebApplicationExtension.UseDocumentation(this WebApplication, Action<SwaggerOptions>) Method”

Configures the route template that can be used to access the OpenAPI documentation.

public static Microsoft.AspNetCore.Builder.WebApplication UseDocumentation(this Microsoft.AspNetCore.Builder.WebApplication webApplication, System.Action<Swashbuckle.AspNetCore.Swagger.SwaggerOptions>? additionalConfiguration=null);

webApplication Microsoft.AspNetCore.Builder.WebApplication

The Microsoft.AspNetCore.Builder.WebApplication to add the route template to.

additionalConfiguration System.Action<Swashbuckle.AspNetCore.Swagger.SwaggerOptions>

An optional action that may be used to tweak the Swashbuckle.AspNetCore.Swagger.SwaggerOptions used for hosting the documentation

Microsoft.AspNetCore.Builder.WebApplication
The webApplication itself for further configuration.

Make sure to call AddDocumentation(this IMvcBuilder, string, string, string, string, string, string, Action<SwaggerGenOptions>) first.

© 2026 Volue.Version v0.6.38017 November 2026