diff --git a/src/Services/feedback-x/O2NextGen.FeedBackX.Api/O2NextGen.FeedBackX.Api.csproj b/src/Services/feedback-x/O2NextGen.FeedBackX.Api/O2NextGen.FeedBackX.Api.csproj index ffe2b91d..1f35a2e8 100644 --- a/src/Services/feedback-x/O2NextGen.FeedBackX.Api/O2NextGen.FeedBackX.Api.csproj +++ b/src/Services/feedback-x/O2NextGen.FeedBackX.Api/O2NextGen.FeedBackX.Api.csproj @@ -11,6 +11,7 @@ + diff --git a/src/Services/feedback-x/O2NextGen.FeedBackX.Api/Properties/launchSettings.json b/src/Services/feedback-x/O2NextGen.FeedBackX.Api/Properties/launchSettings.json index 8834c3c3..de19d468 100644 --- a/src/Services/feedback-x/O2NextGen.FeedBackX.Api/Properties/launchSettings.json +++ b/src/Services/feedback-x/O2NextGen.FeedBackX.Api/Properties/launchSettings.json @@ -4,7 +4,7 @@ "O2NextGen.FeedBackX.Api": { "commandName": "Project", "launchBrowser": true, - "launchUrl": "api/values", + "launchUrl": "swagger", "applicationUrl": "https://localhost:5001;http://localhost:5000", "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development" diff --git a/src/Services/feedback-x/O2NextGen.FeedBackX.Api/Startup.cs b/src/Services/feedback-x/O2NextGen.FeedBackX.Api/Startup.cs index 598e3a12..433cedd4 100644 --- a/src/Services/feedback-x/O2NextGen.FeedBackX.Api/Startup.cs +++ b/src/Services/feedback-x/O2NextGen.FeedBackX.Api/Startup.cs @@ -3,6 +3,7 @@ using Microsoft.AspNetCore.Mvc; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; +using Swashbuckle.AspNetCore.Swagger; namespace O2NextGen.FeedBackX.Api { @@ -19,6 +20,17 @@ public Startup(IConfiguration configuration) public void ConfigureServices(IServiceCollection services) { services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_1); + services.AddSwaggerGen(options => + { + options.DescribeAllEnumsAsStrings(); + options.SwaggerDoc("v1",new Info() + { + Title = "O2NextGen Platform. Feedback-X HTTP API", + Version = "v1", + Description = "Feedback-X API Service. The service allows you to create feedback of o2 prodcuts", + TermsOfService = "Terms of Service" + }); + }); } // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. @@ -33,8 +45,10 @@ public void Configure(IApplicationBuilder app, IHostingEnvironment env) app.UseHsts(); } + app.UseSwagger() + .UseSwaggerUI(c => { c.SwaggerEndpoint($"/swagger/v1/swagger.json", "Feedback-X API V1"); }); app.UseHttpsRedirection(); app.UseMvc(); } } -} +} \ No newline at end of file