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

Maintain route file ordering in SwaggerSpecGenerator #152

Merged
merged 2 commits into from
Apr 5, 2017

Conversation

tculshaw
Copy link
Contributor

@tculshaw tculshaw commented Apr 5, 2017

Test passes, but isn't particularly pleasing to the eye;)

Uses the student routes as the test case - hope that's good enough.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.06%) to 91.398% when pulling 75d3939 on tculshaw:master into 4962ace on iheartradio:master.

Copy link
Member

@kailuowang kailuowang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks very much! See my trivial comment above.

val zgbp = endPointEntries.zipWithIndex.groupBy(_._1._1)
import collection.mutable.LinkedHashMap
val lhm = LinkedHashMap(zgbp.toSeq sortBy (_._2.head._2): _*)
val gbp2 = lhm mapValues (_ map (_._1)) toSeq
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add some comment here to indicate the purpose of these 4 lines is to maintain the order?


// must be in exact order with nothing inbetween
second.get - first.get === 1
third.get - second.get === 1
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could be written as

val result = List(first, second, third, fourth)
result.forall(_.isDefined) === true
result.orderBy(_.get) === result

Right?

@tculshaw
Copy link
Contributor Author

tculshaw commented Apr 5, 2017 via email

@coveralls
Copy link

Coverage Status

Coverage increased (+0.06%) to 91.398% when pulling 5147f99 on tculshaw:master into 4962ace on iheartradio:master.

@kailuowang
Copy link
Member

I see. Makes sense. Thanks again!

@kailuowang kailuowang merged commit f17c236 into iheartradio:master Apr 5, 2017
This was referenced Apr 5, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants