Basic Usage
To include OpenAPI documentation and the Swagger UI in your Wisp project, you will need to install the NuGet package and add some basic configuration.
Install the NuGet Package
Configure the Extension
Program.cs
var hostBuilder = new WispHostBuilder();
hostBuilder.UseOpenApi(); // (1)!
var appBuilder = hostBuilder.Build();
appBuilder.MapOpenApi(); // (2)!
var app = appBuilder.Build();
await app.RunAsync();
- Enable the OpenAPI Extensions
- Map OpenAPI Endpoints for the schema JSON and for Swagger UI.
Access Swagger UI
By default, swagger UI will be available at /openapi/swagger and
the schema will be at /openapi/schema.json.