Swashbuckle.aspnetcore: swaggerui collapsed view by default

Created on 19 Jan 2017  Â·  4Comments  Â·  Source: domaindrivendev/Swashbuckle.AspNetCore

I attempted to use:

app.UseSwaggerUi(c =>
{
c.EnabledValidator(null);
c.DocExpansion("NONE");
});

To set the desired behavior, but regardless of what I set c.DocExpansion to, it's expanding to show all of the endpoints for each of my APIs - wouldn't be too bad if i didn't have a TON.

Am I setting this to the wrong value? Kind of took a mix of the ASP.NET.Core settings & the reference for the .Net version. I'm just trying to achieve the old default view that the .Net version had.

Thanks again for any help.

Most helpful comment

The following code has solved the problem for me, using v3.0.0

app.UseSwaggerUI(c =>
{
  c.DocExpansion(DocExpansion.None);
});

All 4 comments

"none" should work. Most of the SwaggerUi middleware options map pretty closely to the corresponding swagger-ui parameters which you can read about here - https://github.com/swagger-api/swagger-ui#swaggerui

I’ve tried that before, and I just tried again. Still full expansion of endpoints, not fully expanded, but showing all of the calls for each endpoint.

I also tried sending ONLY that option, but that had the same effect. Is there anything I could do to assist in ‘troubleshooting’ / fixing the issue?

Thanks!

From: domaindrivendev [mailto:[email protected]]
Sent: Friday, January 20, 2017 4:09 AM
To: domaindrivendev/Swashbuckle.AspNetCore
Cc: Joel Weiss; Author
Subject: [BULK] Re: [domaindrivendev/Swashbuckle.AspNetCore] swaggerui collapsed view by default (#279)
Importance: Low

"none" should work. Most of the SwaggerUi middleware options map pretty closely to the corresponding swagger-ui parameters which you can read about here - https://github.com/swagger-api/swagger-ui#swaggerui

—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub https://github.com/domaindrivendev/Swashbuckle.AspNetCore/issues/279#issuecomment-274017394 , or mute the thread https://github.com/notifications/unsubscribe-auth/AYCHT9N0I83LGbm37lvkaK0nrOM-AKDpks5rUHmxgaJpZM4Lom3t .

The following code has solved the problem for me, using v3.0.0

app.UseSwaggerUI(c =>
{
  c.DocExpansion(DocExpansion.None);
});

Thank you. It works

Was this page helpful?
0 / 5 - 0 ratings

Related issues

govin picture govin  Â·  3Comments

mrmartan picture mrmartan  Â·  3Comments

voroninp picture voroninp  Â·  3Comments

brucewilkins picture brucewilkins  Â·  3Comments

jluqueba picture jluqueba  Â·  4Comments