Skip to content

Instantly share code, notes, and snippets.

@ebicoglu
Last active May 4, 2020 10:19
Show Gist options
  • Save ebicoglu/60b9617a9dc0a780f7fc729f0496f4cc to your computer and use it in GitHub Desktop.
Save ebicoglu/60b9617a9dc0a780f7fc729f0496f4cc to your computer and use it in GitHub Desktop.
  1. Open Acme.BookStore.IdentityServer.csproj project and add the below package reference:
<PackageReference Include="Swashbuckle.AspNetCore" Version="5.0.0" />

  1. 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);
                });

  1. Add the below code into OnApplicationInitialization() method of BookStoreIdentityServerModule.cs
            app.UseSwaggerUI(options =>
            {
                options.SwaggerEndpoint("/swagger/v1/swagger.json", "BookStore API");
            });
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment