- Open
Acme.BookStore.IdentityServer.csproj
project and add the below package reference:
<PackageReference Include="Swashbuckle.AspNetCore" Version="5.0.0" />
- Add the below code into
ConfigureServices()
method of BookStoreIdentityServerModule.cs
context.Services.AddSwaggerGen(
options =>
{
options.SwaggerDoc("v1", new Microsoft.OpenApi.Models.OpenApiInfo {Title = "BookStore API", Version = "v1"});
options.DocInclusionPredicate((docName, description) => true);
});
- Add the below code into
OnApplicationInitialization()
method of BookStoreIdentityServerModule.cs
app.UseSwaggerUI(options =>
{
options.SwaggerEndpoint("/swagger/v1/swagger.json", "BookStore API");
});