Skip to content

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

@MBelniak

Description

@MBelniak

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions