Keep order of params when generating full spec
What does this PR do?
This PR utilizes yamlloader.ordereddict when loading the input yaml files. This way the order of the attributes does not change when generating the full specification.
Review checklist (to be filled by reviewers)
- [ ] Feature or bug fix MUST have appropriate tests (unit, integration, etc...)
- [ ] PR title must be written as a CHANGELOG entry (see why)
- [ ] Files changes must correspond to the primary purpose of the PR as described in the title (small unrelated changes should have their own PR)
- [ ] PR must have one
changelog/label attached. If applicable it should have thebackward-incompatiblelabel attached. - [ ] PR should not have
do-not-merge/label attached. - [ ] If Applicable, issue must have
kind/andseverity/labels attached at least.
@jirikuncar Done
This issue has been automatically marked as stale because it has not had activity in the last 30 days. Note that the issue will not be automatically closed, but this notification will remind us to investigate why there's been inactivity.
Hi @jirikuncar
I rebased the PR and @ckarageorgkaneen extended it to include the dicts under the components section.
Are you interested in merging it? Is there anything else missing?
@jirikuncar Thank you for the suggestions! I applied both.
@d-mo I have done some testing and it is way slower when merging our large OpenAPI specifications.
# master
$ time apigentools merge
real 0m1.612s
user 0m1.536s
sys 0m0.067s
# pr/204
$ time apigentools merge
real 0m10.816s
user 0m10.577s
sys 0m0.107s
Can we find a way that we could still use the CSafeDumper and CSafeLoader together with the OrderedDict?
@jirikuncar Can you test again? I was able to use CSafeLoader & CSafeDumper after switching to yamlloader.
@d-mo it seems fine now. I don't see any major performance issue on large files.
Hi @jirikuncar.
I fixed the conflicts that came up. Is there any interest in merging this PR at some point?
We'd love to use the official apigentools instead of maintaining our own fork. I think the changes might be useful to others as well.
Thanks