Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question: Consistent and deterministic order in OAS #2937

Closed
g-stone7 opened this issue Mar 11, 2025 · 1 comment
Closed

Question: Consistent and deterministic order in OAS #2937

g-stone7 opened this issue Mar 11, 2025 · 1 comment
Labels
question Further information is requested

Comments

@g-stone7
Copy link

I am using the springdoc-openapi-gradle-plugin to export my api as OAS and generate clients/consumers from it for an angular application. It seems the generated OAS doesn't have a consistent order and on every generation there are a few changes in the git changelog only due to a changed order. From my observations it mainly affects the responses part of the oas per endpoint.

How to reproduce?

  1. Generate oas
  2. Add a new endpoint
  3. Generate oas again

Expected
Diff should only contain changes added in step 2.

Actual
Diff contains changes added in step 2, but changes exist also in some untouched responses only because of a changed order

To clarify: It is not a real issue or bug, but having a deterministic oas generation would keep the diffs small and better understandable. Is there a config option maybe? If not, can this be added?

@bnasslahsen
Copy link
Collaborator

@g-stone7,

Use springdoc.writer-with-order-by-keys=false, which enables a deterministic/alphabetical ordering.

@bnasslahsen bnasslahsen added the question Further information is requested label Mar 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants