20

When I build and run my Azure Web API I get a nice swaggerUI.

I want to add the API to Azure API Management.

For this I need either a URL or the swagger.json file.

Where does Swashbuckle put the file?

Or if it generates it on the fly, how can I get access to it?

Richard210363
  • 8,342
  • 6
  • 37
  • 63

3 Answers3

34

The Swagger.json file should be accessible at [yourwebsitedomain]/swagger/docs/v1

There should also be a link to the swagger.json file at the top of the Swagger UI

  • 1
    Consider expanding on the route: "v1" is only if the configuration is set as such when configured using `c.SingleApiVersion("v1", "[yourwebsitedomain]");` – Kevin R. Dec 06 '16 at 22:30
  • 12
    Is the swagger.json file never actually written to disk? When running my API i can navigate to the JSON file through the webserver but there is no swagger.json file anywhere on the machine. – bytedev Jan 29 '20 at 07:53
  • 3
    for a recent version (v2) this path should work: 'hostname/v2/api-docs' – Athar Apr 16 '20 at 18:58
  • 1
    It would appear that it is never written to disk. This github issue has more info, including some ways you might write the file to disk if desired: https://github.com/domaindrivendev/Swashbuckle/issues/559 – jramm Jul 04 '20 at 21:46
1

there is a link to the swagger.json link on your page.

Micah Armantrout
  • 6,781
  • 4
  • 40
  • 66
0

For me the json was located at the URL:

http://[SERVER]:[PORT]/v1/swagger