From 83f8bd8f5b65380d5b07ef128d272e79f29dd9db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ram=C3=B3n=20Tom=C3=A1s?= Date: Mon, 2 Oct 2017 16:20:59 +0200 Subject: [PATCH] Added swagger to Payment.api --- .../Payment/Payment.API/Payment.API.csproj | 1 + src/Services/Payment/Payment.API/Startup.cs | 14 ++++++++++++++ 2 files changed, 15 insertions(+) diff --git a/src/Services/Payment/Payment.API/Payment.API.csproj b/src/Services/Payment/Payment.API/Payment.API.csproj index 5b7fe983b..ab28a210d 100644 --- a/src/Services/Payment/Payment.API/Payment.API.csproj +++ b/src/Services/Payment/Payment.API/Payment.API.csproj @@ -9,6 +9,7 @@ + diff --git a/src/Services/Payment/Payment.API/Startup.cs b/src/Services/Payment/Payment.API/Startup.cs index 44573c972..44393186b 100644 --- a/src/Services/Payment/Payment.API/Startup.cs +++ b/src/Services/Payment/Payment.API/Startup.cs @@ -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(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();