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

quarkus.smallrye-openapi.servers property should be configurable at runtime #26136

Closed
edeandrea opened this issue Jun 14, 2022 · 5 comments · Fixed by #27172
Closed

quarkus.smallrye-openapi.servers property should be configurable at runtime #26136

edeandrea opened this issue Jun 14, 2022 · 5 comments · Fixed by #27172
Assignees
Milestone

Comments

@edeandrea
Copy link
Contributor

edeandrea commented Jun 14, 2022

Description

The quarkus.smallrye-openapi.servers property is currently a build-time only property. This should be configurable at runtime.

The use case was discussed in #26124, but the TL;DR; is that users may have quarkus.swagger-ui.always-include=true set in their configuration. If so, when the application is deployed anywhere but on the user's local machine, the Swagger UI "try it" no longer works because it is attempting to connect to http://localhost.

Furthermore, it would be pretty impossible to know the URLs of where an application is going to be deployed at build time.

@phillip-kruger did provide a workaround - use the mp.openapi.servers property at runtime instead of quarkus.smallrye-openapi.servers, but shouldn't a configuration property that references a URL be configurable at runtime (like with things like databases/rest clients/etc)?

Implementation ideas

No response

@edeandrea edeandrea added the kind/enhancement New feature or request label Jun 14, 2022
@quarkus-bot
Copy link

quarkus-bot bot commented Jun 14, 2022

@JohnneSouza
Copy link
Contributor

This feature doesn't work on Native Mode (when comes to a value from an environment variable).

@edeandrea
Copy link
Contributor Author

Which feature? The quarkus.smallrye-openapi.servers property or mp.openapi.servers?

@nicolas-vivot
Copy link

nicolas-vivot commented Jul 29, 2022

I think what @JohnneSouza means is that he have the same issue using the Quarkus environment variable.
I could replicate as well, using the Quarkus environment variable.

Since the documentation does not give any restrictions and provide an environment variable, the configuration should be runtime. And this has nothing to do with JVM or Native mode.

Documentation: https://quarkus.io/guides/openapi-swaggerui#quarkus-smallrye-openapi_quarkus.smallrye-openapi.servers

Log error when starting a service:
image

Any chance to fix this or update the documentation accordingly ?

@JohnneSouza
Copy link
Contributor

@nicolas-vivot Yeah, that's what I meant, sorry for the lack of details.

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

Successfully merging a pull request may close this issue.

4 participants