WebApplicationExtension Class
HAKOM.Documentation.Http.Net.Api.Extensions
Section titled “HAKOM.Documentation.Http.Net.Api.Extensions”Provides extension methods for adding automatically generated OpenAPI documentation to an MVC framework based HTTP API.
public static class WebApplicationExtensionInheritance System.Object 🡒 WebApplicationExtension
Methods
Section titled “Methods”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);Parameters
Section titled “Parameters”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
Returns
Section titled “Returns”Microsoft.AspNetCore.Builder.WebApplication
The webApplication itself for further configuration.
Remarks
Section titled “Remarks”Make sure to call AddDocumentation(this IMvcBuilder, string, string, string, string, string, string, Action<SwaggerGenOptions>) first.