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

The configuration quarkus.smallrye-openapi.servers ignores the order in the swagger ui #29444

Closed
wlybe opened this issue Nov 23, 2022 · 5 comments

Comments

@wlybe
Copy link

wlybe commented Nov 23, 2022

Describe the bug

Setting servers on the application properties is randomly ordered.

These two settings show the servers in the same order on the swagger ui:

%dev:
  quar:kus:
    smallrye-openapi:
      servers: https://my.produciton.org, http://localhost:8080

or

%dev:
  quar:kus:
    smallrye-openapi:
      servers: http://localhost:8080, https://my.produciton.org

Maybe this is because on application.properties or application.yaml: quarkus.smallrye-openapi.servers is types java.util.Set. on openapi.yaml, server: array (and not a set)

Expected behavior

https://my.produciton.org appears first on the list in SwaggerUI with this configuration

%dev:
  quar:kus:
    smallrye-openapi:
      servers: https://my.produciton.org, http://localhost:8080

http://localhost:8080 appears first on the list in SwaggerUI with this configuration

%dev:
  quar:kus:
    smallrye-openapi:
      servers: http://localhost:8080, https://my.produciton.org

Actual behavior

These two settings show the servers in the same order on the swagger ui:

%dev:
  quar:kus:
    smallrye-openapi:
      servers: https://my.produciton.org, http://localhost:8080

or

%dev:
  quar:kus:
    smallrye-openapi:
      servers: http://localhost:8080, https://my.produciton.org

How to Reproduce?

  1. add this configuration to application.yaml
%dev:
  quar:kus:
    smallrye-openapi:
      servers: https://my.produciton.org, http://localhost:8080
  1. open the swagger UI
  2. Do the same by changing the servers
%dev:
  quar:kus:
    smallrye-openapi:
      servers: https://my.produciton.org, http://localhost:8080
  1. On swaggerUI, the servers order do not change

Output of uname -a or ver

No response

Output of java -version

openjdk 11.0.17 2022-10-18 LTS

GraalVM version (if different from Java)

No response

Quarkus version or git rev

2.14.1.Final

Build tool (ie. output of mvnw --version or gradlew --version)

Apache Maven 3.8.6

Additional information

No response

@quarkus-bot
Copy link

quarkus-bot bot commented Nov 23, 2022

@gsmet
Copy link
Member

gsmet commented Nov 29, 2022

The Set in the config is not really used but I will change it once we have this fixed in SmallRye OpenAPI, where I think the problem lies. I created a pull request here: smallrye/smallrye-open-api#1323 .

MikeEdgar pushed a commit to smallrye/smallrye-open-api that referenced this issue Nov 30, 2022
@MikeEdgar
Copy link
Contributor

This one was resolved in SR OpenAPI 3.1.1 with #29815

@MikeEdgar
Copy link
Contributor

@gsmet bump - this can be closed as complete.

@gsmet gsmet added this to the 2.16.0.CR1 milestone Mar 7, 2023
@wlybe
Copy link
Author

wlybe commented Mar 9, 2023

Indeed, I tested on Quarkus 2.16.4.Final and it looks ok :)

Thanks !

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

No branches or pull requests

4 participants