'springdoc-openapi-ui How do I set the request to HTTPS

When I publish, I will use HTTPS requests instead of HTTP, but swagger original URL is still HTTP, I have no idea how to set it up, and there is no documentation for servers in the original springdoc-openapi-ui configuration

https://springdoc.org/index.html#properties enter image description here



Solution 1:[1]

you can try this :

...
import io.swagger.v3.oas.annotations.OpenAPIDefinition;
import io.swagger.v3.oas.annotations.servers.Server;
...
@OpenAPIDefinition(servers = {@Server(url = "/", description = "Default Server URL")})

@SpringBootApplication
public class MyApplication {
...
}

more info here https://github.com/springdoc/springdoc-openapi/issues/726

Solution 2:[2]

For who is using CXF. I submitted an issue here:

https://issues.apache.org/jira/browse/CXF-8685

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 David
Solution 2 Thang Le