0

Deployed C# AWS Serverless Application ASP.NET Core WebAPI using Terraform. The project is created using Visual Studio 2019 C# AWS Serverless Application template.The application is integrated with NSwag Swagger package.

I tried to open Swagger UI interface of my WebAPI application, I am getting "Failed to load API definition. Fetch error undefined /Stage/swagger/v1/swagger.json" error. APIs works fine.

Terraform code is based upon https://registry.terraform.io/providers/hashicorp/aws/2.34.0/docs/guides/serverless-with-aws-lambda-and-api-gateway

When I deployed the same application from Visual Studio 2019 by clicking "Publish to AWS Lambda", it works fine. Swagger UI interface of my application opens and APIs also work fine.

Do I need to do anything extra settings to enable swagger UI when deployed using Terraform.

ndp
  • 13
  • 5
  • Does this answer your question? [Swagger not loading - Failed to load API definition: Fetch error undefined](https://stackoverflow.com/questions/56859604/swagger-not-loading-failed-to-load-api-definition-fetch-error-undefined) – Yasen Sep 26 '21 at 08:35
  • [There is a detailed answer](https://stackoverflow.com/a/56959143/5720818) with troubleshooting examples – Yasen Sep 26 '21 at 08:36

0 Answers0