From 1fc7740f2ebb04804f90d5afb09bd35df945d101 Mon Sep 17 00:00:00 2001 From: Jim Schubert Date: Tue, 2 Jul 2019 13:07:17 -0400 Subject: [PATCH] [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. --- .../online/configuration/OpenAPIDocumentationConfig.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/modules/openapi-generator-online/src/main/java/org/openapitools/codegen/online/configuration/OpenAPIDocumentationConfig.java b/modules/openapi-generator-online/src/main/java/org/openapitools/codegen/online/configuration/OpenAPIDocumentationConfig.java index 5eaa29f051a0..07e6001fb35b 100644 --- a/modules/openapi-generator-online/src/main/java/org/openapitools/codegen/online/configuration/OpenAPIDocumentationConfig.java +++ b/modules/openapi-generator-online/src/main/java/org/openapitools/codegen/online/configuration/OpenAPIDocumentationConfig.java @@ -68,7 +68,11 @@ ApiInfo apiInfo() { public Docket customImplementation(){ String host; 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) { host = ""; }