forked from tsai/eShopOnAbp
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
32 lines
1019 B
32 lines
1019 B
using Microsoft.Extensions.DependencyInjection;
|
|
using Microsoft.OpenApi.Models;
|
|
using Volo.Abp.Modularity;
|
|
|
|
namespace EShopOnAbp.Shared.Hosting.AspNetCore;
|
|
|
|
public static class SwaggerConfigurationHelper
|
|
{
|
|
public static void ConfigureWithOidc(
|
|
ServiceConfigurationContext context,
|
|
string authority,
|
|
string[] scopes,
|
|
string apiTitle,
|
|
string apiVersion = "v1",
|
|
string apiName = "v1",
|
|
string[]? flows = null,
|
|
string? discoveryEndpoint = null
|
|
)
|
|
{
|
|
context.Services.AddAbpSwaggerGenWithOidc(
|
|
authority: authority,
|
|
scopes: scopes,
|
|
flows: flows,
|
|
discoveryEndpoint: discoveryEndpoint,
|
|
options =>
|
|
{
|
|
options.SwaggerDoc(apiName, new OpenApiInfo { Title = apiTitle, Version = apiVersion });
|
|
options.DocInclusionPredicate((docName, description) => true);
|
|
options.CustomSchemaIds(type => type.FullName);
|
|
});
|
|
}
|
|
}
|