Skip to content

Commit

Permalink
Retain insertion order when dumping to YAML
Browse files Browse the repository at this point in the history
  • Loading branch information
stuartpullinger committed Nov 22, 2019
1 parent 97cbb72 commit 889e84a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/swagger/swagger_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ def write_swagger_spec(self):
swagger_dict = swagger_spec.get_spec_as_dict()
yaml.Dumper.ignore_aliases = lambda *args: True
with open(SwaggerGenerator.FILE_PATH, "w+") as target:
target.write(yaml.dump(swagger_dict))
target.write(yaml.dump(swagger_dict, sort_keys=False))
target.close()


Expand Down

0 comments on commit 889e84a

Please sign in to comment.