Swagger UI endpoint expand/collapse issue
See original GitHub issueQ&A (please complete the following information)
- OS: Windows
- Browser: Chrome
- Version: 70.0.3538.102
- Method of installation: NuGet Package
- Swagger-UI version: 3.19.5
- Swagger/OpenAPI version: Swagger 2.0
Content & configuration
Swagger-UI configuration options:
app.UseSwaggerUI(c =>
{
c.SwaggerEndpoint("/swagger/v1/swagger.json", "Fifo API");
});
?yourQueryStringConfig
Describe the bug you’re encountering
I am using Swagger UI in AspDotNetCore WebApi Application
When Trying expand the API endpoint drop down from UI, It will be expand all the endpoint with same name & different parameter instead of expanding that specific one.
To reproduce…
Steps to reproduce the behavior:
- Go to http:/localhost/swagger/
- Click on API Endpoint drop down (Make sure you have two endpoint with same name and different parameter)
- Now if you look it will expand all endpoint drop down with same & different parameters
- Same issue with collapse also.
Expected behavior
It should be expand only one API endpoint drop down which is got clicked
Screenshots
1. When page got loaded.
2. I have clicked on 3rd endpoint but all are expanded with same and different parameters
Additional context or thoughts
Issue Analytics
- State:
- Created 5 years ago
- Comments:18 (5 by maintainers)
Top Results From Across the Web
Swagger UI - How can I expand all the operations by default?
I believe you can set the docExpansion:"full" when creating swagger-ui. See https://github.com/swagger-api/swagger-ui#parameters for details ...
Read more >Configuration - Swagger Documentation
Swagger UI accepts configuration parameters in four locations. ... The default expansion depth for models (set to -1 completely hide the models).
Read more >Swagger UI tutorial | Documenting APIs - Idratherbewriting.com
For example, you can set whether each endpoint is expanded or collapsed, how tags and operations are sorted, whether to show request headers...
Read more >Chapter 13. Using the Red Hat Quay API
Lets you connect to endpoints, via a browser, to get, delete, post, and put Red Hat Quay settings by enabling the Swagger UI;...
Read more >Springdoc-openapi Properties
Parameter name Default Value Description
springdoc.swagger‑ui.oauth2RedirectUrl /swagger‑ui/oauth2‑redirect.html String . OAuth re...
springdoc.swagger‑ui.oauth.clientId String . Default cl...
springdoc.swagger‑ui.csrf.enabled false Boolean . To en...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
It looks like several operations have the same
operationId
. Duplicate operationIds are not allowed by the OpenAPI Specification.@nayanishdamania check the relevant annotations in your source code to make sure the operation IDs are unique, or open a ticket with the library you use to generate the spec.
For everyone still having problems here like me and @mariuszkerl, changing the route name of one of the methods with same name will solve the issue.