scottie1984 / swagger-ui-express

Adds middleware to your express app to serve the Swagger UI bound to your Swagger document. This acts as living documentation for your API hosted from within your app.
MIT License
1.43k stars 228 forks source link

Unable to get JSON file for swagger specification. #329

Closed Ishankhan21 closed 1 year ago

Ishankhan21 commented 1 year ago
scottie1984 commented 1 year ago

If you want to serve the json file you can follow this example:

https://github.com/scottie1984/swagger-ui-express#link-to-swagger-document

It was the deliberate intention not to serve the JSON file.

sacummings91 commented 1 year ago

Hey @scottie1984, this example works for setting up the endpoint to be able to get to it from typing the URL in to the browser, but it doesn't render anything on the page to be able to click to get to it.

Based on the docs it seems like the intended behavior is to render a clickable url like https://petstore3.swagger.io/api/v3/openapi.json shown here in the petstore example:

image

Is this a regression or intended behavior? And if it's intended do you know how to render a clickable link?