-
Notifications
You must be signed in to change notification settings - Fork 64
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
Sort HTTP methods, response status codes, and contents lexicographically #163
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #163 +/- ##
==========================================
+ Coverage 96.79% 96.88% +0.08%
==========================================
Files 14 15 +1
Lines 437 449 +12
Branches 97 96 -1
==========================================
+ Hits 423 435 +12
Misses 14 14 ☔ View full report in Codecov by Sentry. |
@exoego I'm using this version and I noticed that it doesn't sort properly. Seems like files that were already generated with the wrong sorting are not being sorted after the update to this version? |
Closes #159
Changes
This is a generalization of #155
The below keys are sorted lexicographically.
/users/
,/users/{id}
. This is already implemented in Sort paths lexicographically so the order of paths is more stable and predictable #155, but refactored.get
,delete
,post
,put
200
,301
,400
,500
application/json
,text/plain
Keys in other places remain as-is.
Alternative considered
I initially implemented sorting every keys in
Hash
recursively, but it feels not good.Keys of some places should remain as-is.
E.g.) Some top-level keys. It makes a bit surprising if
openapi:
keys are in the very bottom of the file.E.g.) The properties of schema. I assume users defined properties as they feel it natural.