mirror of
https://github.com/valitydev/openapi-generator.git
synced 2024-11-06 10:35:25 +00:00
[online] Honor generator environment variable and system property (#3265)
Previously, this pulled from the GENERATOR_HOST system property. This should have been an environment variable. Fallback is now generator.host system property.
This commit is contained in:
parent
b87806834b
commit
1fc7740f2e
@ -68,7 +68,11 @@ public class OpenAPIDocumentationConfig {
|
|||||||
public Docket customImplementation(){
|
public Docket customImplementation(){
|
||||||
String host;
|
String host;
|
||||||
try {
|
try {
|
||||||
host = new URI(System.getProperty("GENERATOR_HOST", "http://localhost")).getHost();
|
String baseUrl = System.getenv("GENERATOR_HOST");
|
||||||
|
if (baseUrl == null) {
|
||||||
|
baseUrl = System.getProperty("generator.host", "http://localhost");
|
||||||
|
}
|
||||||
|
host = new URI(baseUrl).getHost();
|
||||||
} catch (URISyntaxException e) {
|
} catch (URISyntaxException e) {
|
||||||
host = "";
|
host = "";
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user