Skip to content

Swagger-gradle-plugin - inconsistent ordering of API endpoints in generated file. #3738

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

Closed
MBelniak opened this issue Dec 2, 2020 · 2 comments

Comments

@MBelniak
Copy link

MBelniak commented Dec 2, 2020

The ordering of API endpoints seems to change sometimes, without any changes in configuration files and API files. In my case, the ordering changes sometimes, when there are some changes in files from classpath, but these changes do not affect the API itself.
Most of the time endpoints keep lexical order, but sometimes they are mixed regardless if generated file is in json or yml format.
I cannot share my config and code, because they are confidential.
I didn't find any information in docs about forcing the ordering. Do you know a way to ensure that ordering will be the same each time I generate swagger, or I have to implement it by myself? Maybe the ordering depends on the order of files in classpath that is passed to plugin via gradle config?
Expected order:

paths:
  /some/path
...
 /some/path/{id}

Unexpected order that sometimes occur:

paths:
  /some/path/{id}
...
  /some/path
@frantuma
Copy link
Member

frantuma commented Dec 5, 2020

please see #3740 (vesion 2.1.6) which introduces deterministic input and sortOutput parameter along with full customization with objectMapperProcessor.

Closing ticket, please reopen if you're still experiencing issues

@frantuma frantuma closed this as completed Dec 5, 2020
@MBelniak
Copy link
Author

MBelniak commented Dec 5, 2020

Right on time! Thank you :)

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

No branches or pull requests

2 participants