thim81 / openapi-format

Format an OpenAPI document by ordering, formatting and filtering fields.
MIT License
77 stars 14 forks source link

Sort - Sort inline parameters by alphabet #88

Closed thim81 closed 6 months ago

thim81 commented 8 months ago

Linked to #82

thim81 commented 6 months ago

hi @edrandall

For the "diff" use-case, it makes sense to have them sorted. For Request parameters and headers, the DX (developer experience) might be more important.

To support both cases, I'll consider introducing a option to allow the sorting to be turned on/off. Default it will be "off" to respect the manual order set by the OpenAPI designer.

thim81 commented 6 months ago

hi @edrandall,

I had already foreseen a mechanism to sort by using the --sortComponentsFile option. Have a look at the test that shows how you can use this: https://github.com/thim81/openapi-format/tree/main/test/json-sort-request-params