Normalizing OpenApi Spec File
Effectively speaking I have 2 OpenApi Spec json files.
The first is one my team maintains by hand, to define api behavior.
The second is the one swagger generates for my aspnet app.
However the latter, due to its behavior, does generate a totally different looking file as it chooses different points to use $refs, doesn't make use of $allOf, etc etc, so I end up with 2 different spec files that should resolve to the same api in practice.
Is there a tool anyone knows of to normalize these json files though in a deterministic way, to make them easier to compare A to B and different them to sus out deficiencies?
Examples would include:
Anyone know of such a tool?
The first is one my team maintains by hand, to define api behavior.
The second is the one swagger generates for my aspnet app.
However the latter, due to its behavior, does generate a totally different looking file as it chooses different points to use $refs, doesn't make use of $allOf, etc etc, so I end up with 2 different spec files that should resolve to the same api in practice.
Is there a tool anyone knows of to normalize these json files though in a deterministic way, to make them easier to compare A to B and different them to sus out deficiencies?
Examples would include:
- Collapsing all
allOfs to just be the things. - Collapsing
refs to also just be the thing declared - Normalizing property declared orders to be consistent, I assume alphabetically or whatever.
schema section now as a result as everything is now directly declared.Anyone know of such a tool?