I am setting up Swagger for documenting my API.
I have set up the SwaggerEndpoint
with a relative path the the specification json, like you see below:
When I debug locally, everything resolves fine. But my site just runs as http://localhost:44348/index.html
.
When I deploy to IIS, which is on a virtual path, it blows apart:
/imaging4castapi_UAT/
as part of the pathHere's what I've tried:
RoutePrefix
override. But that doesn't resolve."~/swagger/..."
but that's translated by the server on view elements like Razor pages and css and doesn't work here in Startup
.I'm struggling to understand if this is a client setup issue or something related to how my site is hosted on IIS.
Thoughts?
Try using a relative path:
setupAction.SwaggerEndpoint("../swagger/Imaging4CastApiSpecification/swagger.json", "4Cast API");
Please note answer and explanation from the following issue: SwashBuckle
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With