Browse Source

Updated swagger

pull/216/head
Galip Tolga Erdem 3 years ago
parent
commit
b6606698b6
  1. 7
      services/administration/src/EShopOnAbp.AdministrationService.HttpApi.Host/AdministrationServiceHttpApiHostModule.cs
  2. 2
      services/administration/src/EShopOnAbp.AdministrationService.HttpApi.Host/appsettings.json
  3. 2
      services/basket/src/EShopOnAbp.BasketService/BasketServiceModule.cs
  4. 2
      services/catalog/src/EShopOnAbp.CatalogService.HttpApi.Host/CatalogServiceHttpApiHostModule.cs
  5. 2
      services/cmskit/src/EShopOnAbp.CmskitService.HttpApi.Host/CmskitServiceHttpApiHostModule.cs
  6. 2
      services/identity/src/EShopOnAbp.IdentityService.HttpApi.Host/IdentityServiceHttpApiHostModule.cs
  7. 2
      services/ordering/src/EShopOnAbp.OrderingService.HttpApi.Host/OrderingServiceHttpApiHostModule.cs
  8. 2
      services/payment/src/EShopOnAbp.PaymentService.HttpApi.Host/PaymentServiceHttpApiHostModule.cs
  9. 1
      shared/EShopOnAbp.Shared.Hosting.AspNetCore/EShopOnAbp.Shared.Hosting.AspNetCore.csproj
  10. 5
      shared/EShopOnAbp.Shared.Hosting.AspNetCore/EShopOnAbpSharedHostingAspNetCoreModule.cs
  11. 12
      shared/EShopOnAbp.Shared.Hosting.AspNetCore/SwaggerConfigurationHelper.cs
  12. 2
      shared/EShopOnAbp.Shared.Hosting.Gateways/YarpSwaggerUIBuilderExtensions.cs

7
services/administration/src/EShopOnAbp.AdministrationService.HttpApi.Host/AdministrationServiceHttpApiHostModule.cs

@ -8,7 +8,6 @@ using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Volo.Abp;
@ -41,7 +40,6 @@ public class AdministrationServiceHttpApiHostModule : AbpModule
context: context,
authority: configuration["AuthServer:Authority"]!,
scopes: ["AdministrationService"],
flows: ["authorization_code"],
discoveryEndpoint: configuration["AuthServer:MetadataAddress"],
apiTitle: "Administration Service API"
);
@ -98,9 +96,11 @@ public class AdministrationServiceHttpApiHostModule : AbpModule
app.UseRouting();
app.UseAuthentication();
app.UseAbpClaimsMap();
app.UseUnitOfWork();
app.UseDynamicClaims();
app.UseAuthorization();
app.UseSwagger();
app.UseSwaggerUI(options =>
app.UseAbpSwaggerUI(options =>
{
var configuration = context.ServiceProvider.GetRequiredService<IConfiguration>();
options.SwaggerEndpoint("/swagger/v1/swagger.json", "Administration Service API");
@ -108,7 +108,6 @@ public class AdministrationServiceHttpApiHostModule : AbpModule
});
app.UseAbpSerilogEnrichers();
app.UseAuditing();
app.UseUnitOfWork();
app.UseConfiguredEndpoints();
}

2
services/administration/src/EShopOnAbp.AdministrationService.HttpApi.Host/appsettings.json

@ -1,7 +1,7 @@
{
"App": {
"SelfUrl": "https://localhost:44353",
"CorsOrigins": "https://localhost:44372,https://localhost:44373,http://localhost:4200"
"CorsOrigins": "https://localhost:44372,https://localhost:44373,http://localhost:4200,http://localhost:8080"
},
"AuthServer": {
"Authority": "http://localhost:8080/realms/master",

2
services/basket/src/EShopOnAbp.BasketService/BasketServiceModule.cs

@ -95,7 +95,7 @@ public class BasketServiceModule : AbpModule
app.UseAbpClaimsMap();
app.UseAuthorization();
app.UseSwagger();
app.UseSwaggerUI(options =>
app.UseAbpSwaggerUI(options =>
{
var configuration = context.ServiceProvider.GetRequiredService<IConfiguration>();
options.SwaggerEndpoint("/swagger/v1/swagger.json", "Basket Service API");

2
services/catalog/src/EShopOnAbp.CatalogService.HttpApi.Host/CatalogServiceHttpApiHostModule.cs

@ -103,7 +103,7 @@ public class CatalogServiceHttpApiHostModule : AbpModule
app.UseAbpClaimsMap();
app.UseAuthorization();
app.UseSwagger();
app.UseSwaggerUI(options =>
app.UseAbpSwaggerUI(options =>
{
var configuration = context.ServiceProvider.GetRequiredService<IConfiguration>();
options.SwaggerEndpoint("/swagger/v1/swagger.json", "Catalog Service API");

2
services/cmskit/src/EShopOnAbp.CmskitService.HttpApi.Host/CmskitServiceHttpApiHostModule.cs

@ -115,7 +115,7 @@ public class CmskitServiceHttpApiHostModule : AbpModule
app.UseAbpClaimsMap();
app.UseAuthorization();
app.UseSwagger();
app.UseSwaggerUI(options =>
app.UseAbpSwaggerUI(options =>
{
var configuration = context.ServiceProvider.GetRequiredService<IConfiguration>();
options.SwaggerEndpoint("/swagger/v1/swagger.json", "Cmskit Service API");

2
services/identity/src/EShopOnAbp.IdentityService.HttpApi.Host/IdentityServiceHttpApiHostModule.cs

@ -87,7 +87,7 @@ public class IdentityServiceHttpApiHostModule : AbpModule
app.UseAbpClaimsMap();
app.UseAuthorization();
app.UseSwagger();
app.UseSwaggerUI(options =>
app.UseAbpSwaggerUI(options =>
{
var configuration = context.ServiceProvider.GetRequiredService<IConfiguration>();
options.SwaggerEndpoint("/swagger/v1/swagger.json", "Identity Service API");

2
services/ordering/src/EShopOnAbp.OrderingService.HttpApi.Host/OrderingServiceHttpApiHostModule.cs

@ -90,7 +90,7 @@ public class OrderingServiceHttpApiHostModule : AbpModule
app.UseAbpClaimsMap();
app.UseAuthorization();
app.UseSwagger();
app.UseSwaggerUI(options =>
app.UseAbpSwaggerUI(options =>
{
var configuration = context.ServiceProvider.GetRequiredService<IConfiguration>();
options.SwaggerEndpoint("/swagger/v1/swagger.json", "Ordering Service API");

2
services/payment/src/EShopOnAbp.PaymentService.HttpApi.Host/PaymentServiceHttpApiHostModule.cs

@ -81,7 +81,7 @@ public class PaymentServiceHttpApiHostModule : AbpModule
app.UseAbpClaimsMap();
app.UseAuthorization();
app.UseSwagger();
app.UseSwaggerUI(options =>
app.UseAbpSwaggerUI(options =>
{
var configuration = context.ServiceProvider.GetRequiredService<IConfiguration>();
options.SwaggerEndpoint("/swagger/v1/swagger.json", "Payment Service API");

1
shared/EShopOnAbp.Shared.Hosting.AspNetCore/EShopOnAbp.Shared.Hosting.AspNetCore.csproj

@ -14,6 +14,7 @@
<ItemGroup>
<ProjectReference Include="..\EShopOnAbp.Shared.Hosting\EShopOnAbp.Shared.Hosting.csproj" />
<ProjectReference Include="..\EShopOnAbp.Shared.Localization\EShopOnAbp.Shared.Localization.csproj" />
</ItemGroup>
</Project>

5
shared/EShopOnAbp.Shared.Hosting.AspNetCore/EShopOnAbpSharedHostingAspNetCoreModule.cs

@ -6,8 +6,9 @@ namespace EShopOnAbp.Shared.Hosting.AspNetCore;
[DependsOn(
typeof(EShopOnAbpSharedHostingModule),
typeof(AbpSwashbuckleModule),
typeof(AbpAspNetCoreSerilogModule)
typeof(EShopOnAbpSharedLocalizationModule),
typeof(AbpAspNetCoreSerilogModule),
typeof(AbpSwashbuckleModule)
)]
public class EShopOnAbpSharedHostingAspNetCoreModule : AbpModule
{

12
shared/EShopOnAbp.Shared.Hosting.AspNetCore/SwaggerConfigurationHelper.cs

@ -6,18 +6,6 @@ namespace EShopOnAbp.Shared.Hosting.AspNetCore;
public static class SwaggerConfigurationHelper
{
public static void Configure(
ServiceConfigurationContext context,
string apiTitle
)
{
context.Services.AddSwaggerGen(options =>
{
options.SwaggerDoc("v1", new OpenApiInfo {Title = apiTitle, Version = "v1"});
options.DocInclusionPredicate((docName, description) => true);
options.CustomSchemaIds(type => type.FullName);
});
}
public static void ConfigureWithOidc(
ServiceConfigurationContext context,
string authority,

2
shared/EShopOnAbp.Shared.Hosting.Gateways/YarpSwaggerUIBuilderExtensions.cs

@ -14,7 +14,7 @@ public static class YarpSwaggerUIBuilderExtensions
ApplicationInitializationContext context)
{
app.UseSwagger();
app.UseSwaggerUI(options =>
app.UseAbpSwaggerUI(options =>
{
var configuration = context.ServiceProvider.GetRequiredService<IConfiguration>();
var logger = context.ServiceProvider.GetRequiredService<ILogger<ApplicationInitializationContext>>();

Loading…
Cancel
Save