-
Notifications
You must be signed in to change notification settings - Fork 9k
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
Swagger-UI web page hangs when endpoint has several required parameters, but at least one is not provided #8007
Swagger-UI web page hangs when endpoint has several required parameters, but at least one is not provided #8007
Comments
Same problem here but it happens as soon as two fields (more precisely, two required fields, two optional and a request body) FWIW: the first required field is a drop-down list with a default value so it’s not "blankable" in the swagger, but leaving the second required field ends with a hanging request with similar trace to above |
Confirm. Anybody knows a version to downgrade to? |
- name: accessToken
description: Access Token
in: query
required: true
type: string If I have the above parameter the loading hangs and gives the below error in console
No way to cancel loading, have to reload the whole page and lose all the input. If |
This is still an issue. I'm on
|
I traced it for you guys @scott-fisher-iii @char0n , Swagger is getting stuck when there is no |
@ChoppinBlockParty If this is OpenAPI, you must specify |
This is an odd one and I haven't had a chance to dig into the code to see what is happening in the Swagger-UI code.
In one of my company's API products, we have 2 endpoints that have several required parameters (mix of path and query parameters).
One of the problem endpoints has 9 required parameters (6 path; 3 query) and the other has 7 required parameters (6 path; 1 query).
If a user fills in all but one of the required parameters (happens if more than one are left out too), when they click the "Execute" button, the web page hangs. The request interceptor and thus the underlying API are never called. There is no indication to the user where the hang up occurs, the UI just has the spinning "Loading" circle under a now disabled "Execute" button.
The browser console does indicate the following error where Action was the one required parameter not provided:
There seems to be an issue around when there are 7 or more required parameters vs. less than 7. For endpoints that have less than 7 required parameters, the expected behavior (see below) shows. When there are 7 or more required parameters, the UI hangs as described.
The API presently uses the NuGet package "Swashbuckle.AspNetCore" Version="6.3.1" (which uses Swagger-UI v4.10.3) and can be recreated using Chrome and Edge (Chromium).
Expected
When a required parameter is not provided, indicate in the UI (highlight and focus) regardless of how many required parameters are included in that endpoint.
The text was updated successfully, but these errors were encountered: