Browse Source

Added swagger to Payment.api

pull/357/head
Ramón Tomás 7 years ago
parent
commit
83f8bd8f5b
2 changed files with 15 additions and 0 deletions
  1. +1
    -0
      src/Services/Payment/Payment.API/Payment.API.csproj
  2. +14
    -0
      src/Services/Payment/Payment.API/Startup.cs

+ 1
- 0
src/Services/Payment/Payment.API/Payment.API.csproj View File

@ -9,6 +9,7 @@
<ItemGroup>
<PackageReference Include="Autofac.Extensions.DependencyInjection" Version="4.1.0" />
<PackageReference Include="Microsoft.AspNetCore.All" Version="2.0.0" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="1.0.0" />
</ItemGroup>
<ItemGroup>
<DotNetCliToolReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Tools" Version="2.0.0" />


+ 14
- 0
src/Services/Payment/Payment.API/Startup.cs View File

@ -16,6 +16,7 @@ using Payment.API.IntegrationEvents.Events;
using RabbitMQ.Client;
using System;
using System.Threading.Tasks;
using Swashbuckle.AspNetCore.Swagger;
namespace Payment.API
{
@ -75,6 +76,19 @@ namespace Payment.API
checks.AddValueTaskCheck("HTTP Endpoint", () => new ValueTask<IHealthCheckResult>(HealthCheckResult.Healthy("Ok")));
});
// Add framework services.
services.AddSwaggerGen(options =>
{
options.DescribeAllEnumsAsStrings();
options.SwaggerDoc("v1", new Swashbuckle.AspNetCore.Swagger.Info
{
Title = "eShopOnContainers - Payment HTTP API",
Version = "v1",
Description = "The Payment Microservice HTTP API. This is a Data-Driven/CRUD microservice sample",
TermsOfService = "Terms Of Service"
});
});
RegisterEventBus(services);
var container = new ContainerBuilder();


Loading…
Cancel
Save