datamodel-code-generator icon indicating copy to clipboard operation
datamodel-code-generator copied to clipboard

Predictable code generation

Open josemonteiro opened this issue 4 years ago • 2 comments
trafficstars

Is your feature request related to a problem? Please describe. Code generated by different systems (e.g. different OS like Linux and Mac) can be different, because Python classes can be output in different order.

Describe the solution you'd like Code generated should be the same regardless of system used to generate it. This allows reproducible builds and validation in CI/CD systems.

Describe alternatives you've considered Changing generated files with a tool similar to isort but for classes - couldn't find any!

josemonteiro avatar Oct 15 '21 10:10 josemonteiro

@josemonteiro I'm sorry for my late reply. It's a great idea. I would like to add an option to sort classes by name.

koxudaxi avatar Oct 26 '21 01:10 koxudaxi

This would be great! Really looking for this!

andreffs18 avatar Jan 26 '22 12:01 andreffs18

This would be really cool as it sometimes introduces unforeseen problems in our use case :)

captainvera avatar Sep 22 '22 10:09 captainvera

🚀 🙏

andreffs18 avatar Jan 25 '23 08:01 andreffs18

@josemonteiro @andreffs18 @captainvera I'm sorry that my action is too late. I have released a new version, 0.17.0 . The version has a new option, --keep-model-order Thank you very much!!

koxudaxi avatar Jan 30 '23 16:01 koxudaxi

Thank you @koxudaxi!

josemonteiro avatar Jan 30 '23 16:01 josemonteiro

Thank you! @koxudaxi

captainvera avatar Feb 01 '23 12:02 captainvera