Sort HTTP methods, response status codes, and contents lexicographically - #163
Merged
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. |
Contributor
|
@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? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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,put200,301,400,500application/json,text/plainKeys in other places remain as-is.
Alternative considered
I initially implemented sorting every keys in
Hashrecursively, 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.