-
Notifications
You must be signed in to change notification settings - Fork 14
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
Wrong redirection in containerized environment #38
Comments
Hi. Thanks for this. I'll be honest I have no idea how to fix this. But this is the problem code: openapi-ext/openapi-ui/src/main/java/org/microprofileext/openapi/swaggerui/OpenApiUiService.java Line 66 in dac59be
We can maybe introduce a new config where the user can specify the correct base in this case. You are welcome to do a PR ?? |
Sure, will try. |
I currently stumbled over this issue. I thought this feature is already implemented? There is this environment variable
and I have a project in production where I used this and it works. But now I currently try to build another project and the variable is ignored. So now I have the same problem and I wonder how I have managed to get this working in my other project (based on microprofile 2.2) See also the openapi documentation here |
I figured out that it is an issue from openapi and not from the openapi-ui. If you annotate your rest application with the correct data the information is shown through openapi and also used by openapi-ui @ApplicationPath("api")
@OpenAPIDefinition(info = @Info(
title = "Example application",
version = "1.0.0",
contact = @Contact(
name = "John",
email = "john@foo.com",
url = "https://www.foo.com")
),
servers = {
@Server(url = "/",description = "localhost")
}
)
public class BaseApplication extends Application {
} Now I wonder how I can overwrite the 'severs' sections in a container based runtime environment....? The environment variable |
Environment Details
Problem Description
Path /openapi-ui redirects to the wrong URI if the MicroProfile app is running inside of Docker container. Extension swaps the host and port to values defined by the container.
I haven't dived deep into the bug, but at least I realized that injected
javax.ws.rs.core.UriInfo
provides the wrong base URI. As far as I know, Helidon uses Jersey as JAX-RS implementation. So, this problem could be Jersey-specific.Steps to reproduce
Steps to reproduce:
Browser redirects to the wrong path: http://172.17.0.2:8080/openapi-ui/index.html
Where 172.17.0.2 is the Docker container internal IP and 8080 is the port of the app running inside of the container.
By the way, everything works fine if you specify the full path: http://127.0.0.1:9090/openapi-ui/index.html
The text was updated successfully, but these errors were encountered: