quarkusio / quarkus

Quarkus: Supersonic Subatomic Java.
https://quarkus.io
Apache License 2.0
13.56k stars 2.62k forks source link

Quarkus management interface and Swagger UI executing APIs at wrong path #39561

Open ccarv opened 5 months ago

ccarv commented 5 months ago

Describe the bug

When the quarkus.management.enabled is set to true, it binds the OpenAPI extension to this interface as well. This is expected according to Quarkus management interface documentation.

However, when using the Swagger UI interface to interact with APIs, it does not invoke the proper URL where the API services are actually bound.

Expected behavior

If my services are bound to HTTPS on port 8443 and my management port is bound to HTTP on port 9000, Swagger-UI should properly execute services calls to HTTPS on port 8443.

Actual behavior

Swagger UI is invoking API services calls on the same management port 9000 on HTTP.

How to Reproduce?

  1. APIs should be bound to HTTPS
  2. Management port bound to HTTP
  3. Navigate to http://localhost:9000/q/swagger-ui and execute one of the APIs

Output of uname -a or ver

No response

Output of java -version

java 17.0.9 2023-10-17 LTS

Quarkus version or git rev

3.7.1

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

17.0.9

Additional information

No response

quarkus-bot[bot] commented 5 months ago

/cc @EricWittmann (openapi), @MikeEdgar (openapi,swagger-ui), @phillip-kruger (openapi,swagger-ui)

phillip-kruger commented 5 months ago

As a workaround you can add this (quarkus.smallrye-openapi.servers) config:

quarkus.smallrye-openapi.servers=https://localhost:8443/`

I'll look into doing this automatically when management is enabled.

phillip-kruger commented 5 months ago

This seems to fix (I might have fixed it). Can you try with the latest version ?