|
@ -214,13 +214,29 @@ static class CustomExtensionsMethods |
|
|
public static IServiceCollection AddCustomSwagger(this IServiceCollection services, IConfiguration configuration) |
|
|
public static IServiceCollection AddCustomSwagger(this IServiceCollection services, IConfiguration configuration) |
|
|
{ |
|
|
{ |
|
|
services.AddSwaggerGen(options => |
|
|
services.AddSwaggerGen(options => |
|
|
{ |
|
|
|
|
|
|
|
|
{ |
|
|
|
|
|
var basePath = AppDomain.CurrentDomain.BaseDirectory; |
|
|
|
|
|
var fileName = typeof(Startup).GetTypeInfo().Assembly.GetName().Name + ".xml"; |
|
|
|
|
|
var xmlComments = Path.Combine(basePath, fileName); |
|
|
|
|
|
options.IncludeXmlComments(xmlComments); |
|
|
options.SwaggerDoc("v1", new OpenApiInfo |
|
|
options.SwaggerDoc("v1", new OpenApiInfo |
|
|
{ |
|
|
{ |
|
|
Title = "eShopOnContainers - Ordering HTTP API", |
|
|
Title = "eShopOnContainers - Ordering HTTP API", |
|
|
Version = "v1", |
|
|
Version = "v1", |
|
|
Description = "The Ordering Service HTTP API" |
|
|
|
|
|
|
|
|
Description = "The Ordering Service HTTP API", |
|
|
|
|
|
TermsOfService = new Uri("https://microsoft.com/terms"), |
|
|
|
|
|
Contact = new OpenApiContact |
|
|
|
|
|
{ |
|
|
|
|
|
Name = "Microsoft Contact", |
|
|
|
|
|
Url = new Uri("https://microsoft.com/") |
|
|
|
|
|
}, |
|
|
|
|
|
License = new OpenApiLicense |
|
|
|
|
|
{ |
|
|
|
|
|
Name = "Microsoft License", |
|
|
|
|
|
Url = new Uri("https://microsoft.com/") |
|
|
|
|
|
} |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
options.AddSecurityDefinition("oauth2", new OpenApiSecurityScheme |
|
|
options.AddSecurityDefinition("oauth2", new OpenApiSecurityScheme |
|
|
{ |
|
|
{ |
|
|
Type = SecuritySchemeType.OAuth2, |
|
|
Type = SecuritySchemeType.OAuth2, |
|
|