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

Request: Ability to disable sorting of parameters #281

Closed
HansAarneLiblik opened this issue Feb 1, 2021 · 3 comments
Closed

Request: Ability to disable sorting of parameters #281

HansAarneLiblik opened this issue Feb 1, 2021 · 3 comments
Labels
enhancement New feature or request fix confirmation pending issue has been fixed and confirmation from issue reporter is pending

Comments

@HansAarneLiblik
Copy link

Currently in AutoSchema class in openapi.py#38 in _get_parameters#176 method as a last step parameters for a endpoint are sorted by name

... 
return sorted(parameters.values(), key=lambda p: p['name'])

This requires us to override this method just to replace it with

...
return list(parameters.values())

because we would like to keep our parameters to be grouped logically together as we defined them, as one would do for perhaps function parameters.

Could this perhaps be a thing that is toggleable in settings?

@tfranzel tfranzel added the enhancement New feature or request label Feb 10, 2021
@tfranzel
Copy link
Owner

i can see how this makes sense. will do

@tfranzel tfranzel added the fix confirmation pending issue has been fixed and confirmation from issue reporter is pending label Feb 10, 2021
@intgr
Copy link
Contributor

intgr commented Feb 11, 2021

Thank you for implementing this feature so quickly. I can confirm that SORT_OPERATION_PARAMETERS = False works for me.

@tfranzel
Copy link
Owner

closing this issue for now. feel free to comment if anything is missing or not working and we will follow-up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request fix confirmation pending issue has been fixed and confirmation from issue reporter is pending
Projects
None yet
Development

No branches or pull requests

3 participants