-
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
Path-level parameters are not displayed in the UI #2791
Comments
You shouldn't specify |
Autorest does not send "Accept" header without explicity adding it in parameters, even if all operations have set So currently there is no way to use Autorest both with Swagger UI v3, that's why I open this issue. |
That's an issue for Autorest to resolve then, as they don't follow the spec. |
By the way, I did not see in specs anywhere that if you define "Accept" header parameter that client must stop work as Swagger UI 3 does. Moreover Swagger UI 3 does not work with any header parameter, defined at path level, not only |
"parameters" :
[{
"name":"X-Test",
"in":"header",
"description":"Test Header",
"type":"string",
"required":true,
"enum":["application/json"]
}] is defined at path level. If click "execute" button, I've got error message in console: "Required parameter X-Test is not provided" |
The issue with path level parameters has been resolved - swagger-api/swagger-js#972. Which version of swagger-ui do you test with? Do you experience that the parameter is not rendered but is still required? If so, it'd help to get a full spec reproducing the issue. I understand the spec might not be very clear about the |
If define "X-Test" parameter at operation level Swagger UI 3 does not send requests to server, when click "Execute" button. Swagger UI 2.2.10 does this job correctly both at operation and path level. |
At path level "X-Test" does not show in UI, at operation level it shows in UI, but still not work. |
Yup, I see it now. |
Parameters should be displayed now. Please reopen otherwise. |
I have following definition of "Accept" parameter
If I put this declaration on
paths
level, then this parameter is not shown in UI and when I click "Execute" button, I see error message in console that required "Accept" parameter is not set.If I put this parameter on operation level, then I see it on UI, but when click "Execute" button it does not send request to server and does not show anything in response, errors or console.
If I remove this parameter completely, then Swagger UI starts work as expected.
But I can't remove it, because Azure/Autorest client does not send 'accept' headers with appropriate mime type without the parameter and I have to keep it in schema to make autorest generated clients work.
This is on v3.0.3 of Swagger UI, on previous version (2.2.10) it works correctly in all cases
The text was updated successfully, but these errors were encountered: