Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Collapse tags and models by default #3088

Closed
1Map opened this issue May 16, 2017 · 8 comments
Closed

Collapse tags and models by default #3088

1Map opened this issue May 16, 2017 · 8 comments

Comments

@1Map
Copy link

1Map commented May 16, 2017

How can I collapse tags and models section by default. See screenshot:

image

@webron
Copy link
Contributor

webron commented May 16, 2017

We currently do not expose that as a configuration option.

@urukalo
Copy link

urukalo commented May 19, 2017

Is there any suggestion how to resolve this elegantly?

@Cheprer
Copy link

Cheprer commented Jun 26, 2017

Using the bundle you can specify parameter 'docExpansion'

SwaggerUIBundle({
    url: "http://urltoswaggerfile.com",
    dom_id: '#swagger-ui',
    docExpansion: 'none',
    presets: [
      SwaggerUIBundle.presets.apis,
      SwaggerUIStandalonePreset
    ],
    plugins: [
      SwaggerUIBundle.plugins.DownloadUrl
    ],
    layout: "StandaloneLayout"
  });

@webron
Copy link
Contributor

webron commented Jun 26, 2017

Thanks, @Cheprer. With the new config option, this issue can be closed.

@webron webron closed this as completed Jun 26, 2017
@heldersepu
Copy link
Contributor

heldersepu commented Jul 17, 2017

The docExpansion controls both tags and models...
Is there an option for just the models?

@ddiego2kddl
Copy link

docExpansion: 'none' works fine for me. Thx

@JS-Java-fullstack
Copy link

I did it by adding the required changes in the swaggerUi. You need to change it as per your requirement as below;

  1. docExpansion : "none" - It'll Hide everything.
  2. docExpansion : "list"- It'll expand/List all the operations only.
  3. docExpansion : "full" - It'll expand everything(Full expand as the name says).

@BordalloG
Copy link

It may help someone :
applicationBuilder.UseSwagger()
.UseSwaggerUI(options =>
{
options.DocExpansion(DocExpansion.None);
});

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

8 participants