contiamo / restful-react

A consistent, declarative way of interacting with RESTful backends, featuring code-generation from Swagger and OpenAPI specs 🔥
MIT License
1.87k stars 109 forks source link

Stable Code Generation. #359

Closed vkbansal closed 3 years ago

vkbansal commented 3 years ago

Is your feature request related to a problem? Please describe. Our swagger.json is generated dynamically and hence the order of objects is not guaranteed. This creates a large diff every time because the interfaces and their keys are always in random order.

Describe the solution you'd like I'd like all the definitions to be sorted by names. (even the keys of the interfaces and string enums)

fabien0102 commented 3 years ago

Hi @vkbansal, I'm sorry, but, from the library perspective, the code generation is stable (same input -> same output). I don't know how your swagger.json is generated, but you open an issue on this side, I don't really any quick win to have an ordered input here.

(this said, if you have an idea of API & implementation, we will always be happy to collaborate on a pull-request)

vkbansal commented 3 years ago

I have an idea on how to implement it. I was wondering if you will be open to such a feature if I open a PR. I do not want to start working on it, if it is not going to be accepted.

fabien0102 commented 3 years ago

If this is an option in restful-react.config.js and don't break the "natural" order, I'm totally fine with this 👍