You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
.Net Core 5.0 web api project with Swashbuckle.AspNetCore version 5.6.3.
ISSUE-:
Swagger index.html page or the Swagger json file not accessible after deployment to AWS with a Load balancer url.
STEPS TO REPRODUCE:
I am working in a team in which we have created a solution with multiple Web API projects. Each project has its own startup.cs file & the corresponding swagger configuration details.
Currently we are having two such web api projects -: masterService, userService.
In masterService api project, we have kept the swagger configuration as it is (i.e., in configureServices(), we have services.AddSwaggerGen(...) & in configure(), we have the app.UseSwagger(), app.UseSwaggerUI(options=> options.swaggerEndpoint('/swagger/v1/swagger.json', 'masterservice v1').
Now this Web API is build through Dockerfile & then Jenkins pipeline deploys it to AWS. In AWS we have loadbalancer.
EXPECTED RESULT:
Accessing the /swagger/index.html page using loadbalancer url (i.e, https://loadbalancerurl/swagger/index.html) should show the swagger index.html page with all API endpoints of masterService.
ACTUAL RESULT:
When requested through browser, 404 is returned.
##TRIED:##
I tried to modify the swagger url like /masterService/swagger/index.html (as we have multiple api projects) using routeTemplate(...), then routePefix but no luck. Then I reverted back to the old solution.
##Question:##
What is the issue here? Kindly help.
The text was updated successfully, but these errors were encountered:
.Net Core 5.0 web api project with Swashbuckle.AspNetCore version 5.6.3.
ISSUE-:
Swagger index.html page or the Swagger json file not accessible after deployment to AWS with a Load balancer url.
STEPS TO REPRODUCE:
I am working in a team in which we have created a solution with multiple Web API projects. Each project has its own startup.cs file & the corresponding swagger configuration details.
Currently we are having two such web api projects -: masterService, userService.
In masterService api project, we have kept the swagger configuration as it is (i.e., in configureServices(), we have services.AddSwaggerGen(...) & in configure(), we have the app.UseSwagger(), app.UseSwaggerUI(options=> options.swaggerEndpoint('/swagger/v1/swagger.json', 'masterservice v1').
Now this Web API is build through Dockerfile & then Jenkins pipeline deploys it to AWS. In AWS we have loadbalancer.
EXPECTED RESULT:
Accessing the /swagger/index.html page using loadbalancer url (i.e, https://loadbalancerurl/swagger/index.html) should show the swagger index.html page with all API endpoints of masterService.
ACTUAL RESULT:
When requested through browser, 404 is returned.
##TRIED:##
I tried to modify the swagger url like /masterService/swagger/index.html (as we have multiple api projects) using routeTemplate(...), then routePefix but no luck. Then I reverted back to the old solution.
##Question:##
What is the issue here? Kindly help.
The text was updated successfully, but these errors were encountered: