swagger-converter
swagger-converter copied to clipboard
add preserveOrder option to avoid sorting keys
Currently swagger-converter sorts all keys to make sure the output is deterministic. In some cases, the order of properties matters.
For instance a model that understandably mentions id and name first. For code generation and example generation it helps to keep these properties first.
preserveOrder: true
may help in these cases.
The current setup for tests was not really made for potentially non-deterministic outputs (which preserveOrder
could result in). I left out the test for now, let me know what the best course of action is for this, or whether it should be left ignored.
@bobvanderlinden Sorry for the super late response. But can we just add code that always puts id and name first? I think it universally useful feature so why hide it behind the flag? More properties can be added in the future.