You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
The update command when executed with an unchanged openapi yaml file multiple times results in template model and operation files with different orders of imports at the top of the file. If the resulting client is stored in a git repository, this causes unecessary differences between commits. "Non-deterministic" is intended in the meaning of the order of the imports rather than the set which appears to be the same regardless of the number of update commands.
To Reproduce
Steps to reproduce the behavior:
Generate a client from an openapi yaml file.
Commit the output client to a git repo (optional, but makes the symptom easier to see)
Update a client from the same, unchanged openapi yaml file.
Run a git diff to see the changed import ordering (usually in almost every generated file)
Expected behavior
An order-preserved set of import statements for each generated file.
OpenAPI Spec File
Any OpenAPI yaml file.
Desktop (please complete the following information):
OS: Ubuntu Desktop 20
Python Version: 3.8.x
openapi-python-client version: 0.10.1 ( using pipx run openapi-python-client )
The text was updated successfully, but these errors were encountered:
@bolbken it turns out we are already using isort it's just that the suggestion of how to run with pipx ensured that isort never ran 😬. I'm updating the instructions for 0.10.4 to make it possible to work, as well as adding in the option to specify your own post-generation hooks. See #479
Describe the bug
The update command when executed with an unchanged openapi yaml file multiple times results in template model and operation files with different orders of imports at the top of the file. If the resulting client is stored in a git repository, this causes unecessary differences between commits. "Non-deterministic" is intended in the meaning of the order of the imports rather than the set which appears to be the same regardless of the number of update commands.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
An order-preserved set of import statements for each generated file.
OpenAPI Spec File
Any OpenAPI yaml file.
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: