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

Random sorting of operations on summary pages #52

Closed
liborjelinek opened this issue Apr 28, 2017 · 5 comments
Closed

Random sorting of operations on summary pages #52

liborjelinek opened this issue Apr 28, 2017 · 5 comments

Comments

@liborjelinek
Copy link

Operations listed at "summary" pages obviously don't respect ordering in JSON source. Each time I re-run dopperdox I see different order of operations. This is pretty inconvenient.

@zxchris
Copy link
Collaborator

zxchris commented Apr 30, 2017

Yes, that will be inconvenient!
The intention was for these to be ordered alphabetically, so that they are consistent. Ideally, I would like them to maintain the order in the specification but, alas, they're defined as a map in the JSON spec, not an array, so ordering can't be guaranteed. We found forcing alphabetical ordering for such things looks "right" to the reader.

However, this seems to have been overlooked (or broken!) on the summary pages.

Thanks for the report.
Will fix!

@liborjelinek
Copy link
Author

Thanks for your interest! Yes, that's a pitty that's JSON object with not guaraned ordering, not list.

But as ideal I consider adding another x- extension to Swagger file. Good name IMHO would be x-sortOrder to be consistent with SortOrder metadata with identical semantics - value coud be alphanumeric string however usually users will pick numeric values (where smaller number means bigger priority).

Alphabetically sorting would be a "fallback" if x-sortOrder is missing.

I also think how to handle if some operations have x-sortOrder and some miss it... How do you handle with it in the case of SortOrder? Again, let's implement it with identical behaviour.

@zxchris
Copy link
Collaborator

zxchris commented Oct 2, 2017

We're looking at this at the moment and would appreciate any feedback you may have on our comments/suggestions on pull-request #68 before we implement (or merge) a solution.

@Kerzman
Copy link

Kerzman commented Nov 2, 2017

Hey, we are facing the same issue,
any news about this PR?

@zxchris
Copy link
Collaborator

zxchris commented Mar 8, 2018

We've implemented this in version 1.2.0. See controlling method order

@zxchris zxchris closed this as completed Mar 8, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants