-
Notifications
You must be signed in to change notification settings - Fork 6
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
Add sorting decorators (like old Redoc had) #38
Conversation
Does this also include a custom rule to specify the order expected by the linter? |
I don't have a rule for the method ordering included, but I think we can add one. |
I agree that it should accept a config for method order (maybe it can have a default for zero config). I can see particular people wanting to go in some specific order though which might not be alphabetical (such as |
Yeah for us we want GET, POST, PUT, DELETE
…On Thu, Aug 22, 2024 at 6:56 PM Adam Altman ***@***.***> wrote:
I agree that it should accept a config for method order (maybe it can have
a default for zero config). I can see particular people wanting to go in
some specific order though which might not be alphabetical (such as DELETE
last).
—
Reply to this email directly, view it on GitHub
<#38 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAKWZQ6264CWOD3P7NAFIALZS2JE3AVCNFSM6AAAAABMUK2YU6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMBWGAZTKNZQHA>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left a few comments from the code style prospective.
Shall we push this one through to completion? Seems powerful. |
Co-authored-by: Andrew Tatomyr <[email protected]>
@adamaltman Definitely! Want to take another look? I added the extra rules we discussed. @thesteve0 I added a |
PathItem: { | ||
enter(pathItem, ctx) { | ||
// default method sort order, can be changed with an "order" param in config | ||
let methodOrder = ["post", "patch", "put", "get", "delete"]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we add head, options?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't on the basis that it's configurable so here's a very mainstream starter set and people can work on it from there. Although now you mention it, maybe "get" should be first!
Adds some of the sorting features that older versions of open source Redoc (v1 and v2) could apply at display time so that they can be used at any stage of the API lifecycle.