Skip to content

WIP: Order HTTP Methods To Lessen Openapi JSON Diffs - #257

Open
ihassanein wants to merge 1 commit into
mainfrom
iman/v2-v3-spec-ordering
Open

WIP: Order HTTP Methods To Lessen Openapi JSON Diffs#257
ihassanein wants to merge 1 commit into
mainfrom
iman/v2-v3-spec-ordering

Conversation

@ihassanein

Copy link
Copy Markdown
Contributor

Introduces a new post-processing step to assure that each openapi-v#.json does not include reordering of http methods as it hides things in the diff that could help us flag if things are being subtly added to the public api 👀
While testing I also saw schemas were changing order, so long as we do not touch the contents of the schema and just order them by their schema name this should bring no change to how information is presented in the documentation. I added another step scoped to just this.

When re-running the generate script more than once, the only noise that remains in the diff is the order of search_types. This did not seem like a quick win to do within the docs repo and instead something we would need to investigate in the main codebase to determine why the order changes each run.

Example diff after running the generate script, making a first commit, and running it again.

Screenshot 2026-08-28 at 6 16 01 PM

Ignoring the changes to swagger that I did not touch, the V2's 49 lines changed and the V3's 2 lines changed are all related to search_types

Screenshot 2026-08-28 at 6 20 16 PM

@mintlify

mintlify Bot commented Aug 28, 2026

Copy link
Copy Markdown

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
flare 🟢 Ready View Preview Aug 28, 2026, 10:22 PM

💡 Tip: Enable Workflows to automatically generate PRs for you.

@aaparent

Copy link
Copy Markdown
Member

I'd only argue about the fact the functions are doing side effects (I'd prefer them to return a dict) and have pure functions:

schema_without_private_ops = remove_private_operations(openapi_schema)
cleaned_schema = remove_unused_schemas(schema_without_private_ops)
sorted_schema = sort_schemas(sort_path_item_methods(cleaned_schema))

It's a detail as the other functions are doing side effects.

Otherwise that's a great addition !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants