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 226 forks source link

endpoints collapsed by default? #18

Closed coderofsalvation closed 7 years ago

coderofsalvation commented 7 years ago

Anyone got the endpoints collapsed by default? This does't seems to be the options, but doesn't to do the trick:

swaggerUi.setup(swaggerDocument, false, {docExpansion:"none"})

scottie1984 commented 7 years ago

This is currently an issue with Swagger UI:

https://github.com/swagger-api/swagger-ui/issues/2799

If they fix I can upgrade this module to the latest version.

coderofsalvation commented 7 years ago

ok thx!

webron commented 7 years ago

The fix is available in master, should be released this Friday.

coderofsalvation commented 7 years ago

awesome!

On Tue, Jun 6, 2017 at 6:20 PM, Ron notifications@github.com wrote:

The fix is available in master, should be released this Friday.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/scottie1984/swagger-ui-express/issues/18#issuecomment-306539388, or mute the thread https://github.com/notifications/unsubscribe-auth/AAK_ZJSCVT_rn6Qi74TjDMzrtoe4DnFUks5sBXxagaJpZM4NvWRV .

-- /WEBSITE 2wa.isvery.ninja /MOBILE +31 6 13499604 /LOCATION Netherlands, Drachten. Hongarije, Budapest. /COMPANYNR. 08124656 /TAGS Rapid Prototyping of ideas/concepts using JavaScript, Node.js, OpenSource. Growth-hacking partnerships, lead scraping partnerships.

jgslima commented 7 years ago

Good! Thx!

scottie1984 commented 7 years ago

Should be fixed now in 2.0.1 which I just published

coderofsalvation commented 7 years ago

awesome thanks!

On Fri, Jun 30, 2017 at 10:21 PM, Stephen Scott notifications@github.com wrote:

Should be fixed now in 2.0.1 which I just published

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/scottie1984/swagger-ui-express/issues/18#issuecomment-312364301, or mute the thread https://github.com/notifications/unsubscribe-auth/AAK_ZLNecJ89r8vwm-OD0qPPSiFQgJ5Gks5sJVizgaJpZM4NvWRV .

-- /WEBSITE 2wa.isvery.ninja /MOBILE +31 6 13499604 /LOCATION Netherlands, Drachten. Hongarije, Budapest. /COMPANYNR. 08124656 /TAGS Rapid Prototyping of ideas/concepts using JavaScript, Node.js, OpenSource. Growth-hacking partnerships, lead scraping partnerships.

v-vashchenko commented 5 years ago

is there a way to do this with the options argument(not 'false')?

scottie1984 commented 5 years ago

should be:

var options = {
  swaggerOptions: {
    docExpansion:"none"
  }
};
v-vashchenko commented 5 years ago

@scottie1984 Thanks a lot! Stuck on this for hours, the solution was hiding this 'manualy' with js

iofirag commented 10 months ago

works for me.

const express = require("express");
const app = express();
const swaggerUi = require('swagger-ui-express');
const swaggerDoc = require('./swagger-output.json');

app.use('/doc', swaggerUi.serve, swaggerUi.setup(swaggerDoc, false, { docExpansion: 'none' }));