Added swagger to Payment.api
This commit is contained in:
		
							parent
							
								
									99dd90e699
								
							
						
					
					
						commit
						83f8bd8f5b
					
				| @ -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" /> | ||||
|  | ||||
| @ -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…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user