We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
springdoc
Learn more about funding links in repositories.
Report abuse
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
Describe the bug
Multiple @ApiResponse annotations inside an @ApiResponses annotation do not keep their order when the openapi spec / "responses" field is generated.
To Reproduce Steps to reproduce the behavior:
@ApiResponses( value = { @ApiResponse( responseCode = "200", description = "OK."), @ApiResponse( responseCode = "401", description = "Unauthorized access.") })
leads to
"responses": { "401": { "description": "Unauthorized access." }, "200": { "description": "OK." } }
Expected behavior
"responses": { "200": { "description": "OK." }, "401": { "description": "Unauthorized access." } }
Additional context I'm pretty sure the reason is that at https://github.com/springdoc/springdoc-openapi/blob/main/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/GenericResponseService.java#L486 the streams are collected with .collect(Collectors.toSet()) - collecting into a LinkedHashSet instead should lead to a stable ordering.
The text was updated successfully, but these errors were encountered:
296beed
Thanks for taking care of this :)
Sorry, something went wrong.
thank you for fixing this. I ran into this issue with parameters and generating clients. I'll be upgrading to 2.8.5 soon :)
parameters
No branches or pull requests
Describe the bug
Multiple @ApiResponse annotations inside an @ApiResponses annotation do not keep their order when the openapi spec / "responses" field is generated.
To Reproduce
Steps to reproduce the behavior:
leads to
Expected behavior
Additional context
I'm pretty sure the reason is that at https://github.com/springdoc/springdoc-openapi/blob/main/springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/GenericResponseService.java#L486 the streams are collected with .collect(Collectors.toSet()) - collecting into a LinkedHashSet instead should lead to a stable ordering.
The text was updated successfully, but these errors were encountered: