-
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 should be listed before operation-level parameters #7482
Comments
@hkosova @char0n this is not possible to do in swagger-ui. The fn
input operation level:
result:
|
Hi all, The new behavior suggested by @hkosova makes total sense (at least from my subjective perspective and others, that this has been discussed with). @mathis-m I went through the #6745 and swagger-api/swagger-js#2256. I think we first need to define our expectations here. IMHO there is couple of things here that we need to decide and clarify. GroupingGrouping was introduced in #6745. We currently group Parameter Objects by SortingWe currently don't sort. It looks like we do because What do we really want?IMHO it would be beneficial to define the expected behavior here to the last intricate detail. I'm putting here the first proposal that we can elaborate on. Proposal 1 - Rendering according the the user intentionWe trust the OAS definition author, that she knows what she's doing and that she's defined the order of the parameters in the order that she deemed appropriate. The user then expects the parameters to be rendered in the order as she defined them. And here comes the @hkosova proposal - parameters defined in Path Item Object get rendered before Operation level parameters. This means we have to get rid of current grouping algorithm. Please let me know what you think about this proposal. Feel free to provide your own proposal of expected behaviors. |
@char0n I understand proposal 1, but as a user I see 2 usability points that need consideration.
UX considerations that could fix this, is a table that can be sorted. Regarding #6661 and the points mentioned above I think there is the need of providing such functionality, either in automatic or manual way. So this might need some UX input to find a solution:
|
Q&A (please complete the following information)
Content & configuration
Example Swagger/OpenAPI definition:
Describe the bug you're encountering
In the API definition provided above, the
/something/{id}
path has path-level parameterid
, plus the GET operation defines an additional parameterfoo
.Swagger UI renders the path-level parameter
id
AFTER the operation-level parametersfoo
. This is often undesirable because path-level parameter list often containsin: path
parameters (which are required), so it makes more sense to render path-level parameters first.To reproduce...
Steps to reproduce the behavior:
Expected behavior
Parameter order is:
id
first, thenfoo
.Actual behavior
Parameter order is:
foo
,id
.Screenshots
The text was updated successfully, but these errors were encountered: