Last active
February 7, 2024 06:28
-
-
Save gistlyn/903e51568e47155411f6f51e10560aee to your computer and use it in GitHub Desktop.
Configure support for Open API and Swagger UI
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dotnet add package ServiceStack.Api.OpenApi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using ServiceStack; | |
using ServiceStack.Api.OpenApi; | |
[assembly: HostingStartup(typeof(MyApp.ConfigureOpenApi))] | |
namespace MyApp; | |
public class ConfigureOpenApi : IHostingStartup | |
{ | |
public void Configure(IWebHostBuilder builder) => builder | |
.ConfigureServices(services => { | |
services.AddPlugin(new OpenApiFeature()); | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment