When you have the same name of API Endpoints in the same controller then it will give this error.
Failed to load Swagger API definition for a Newly Published .NET Core 6.0 API
I just pushed a .NET Core 6.0 WebAPI to Azure AppService. When I access the location I receive
the following error issued when accessing the default URL at https://visionsuitecore.azurewebsites.net/index.html below:
Message: Failed to load API definition.
Fetch error
Not Found https://visionsuitecore.azurewebsites.net/v1/swagger.json
My API works perfectly using localhost and within my code, the swagger.json should be located at
https://visionsuitecore.azurewebsites.net/swagger/v1/swagger.json. Further, if I access the URL directly
I can view the contents of the swagger.json as expected.
Why is this and how can I fix it? Please Advise.
Bill Eisenman
FastTrak@Luxsparks .com
2 answers
Sort by: Most helpful
-
-
Chanchal Rawat 1 Reputation point
2022-10-14T12:06:28.907+00:00