[BUG] openapi-generator-online require environment variable to define scheme/host/port in generated download links
Bug Report Checklist
-
Have you provided a full/minimal spec to reproduce the issue? -
Have you validated the input using an OpenAPI validator (example)? -
What's the version of OpenAPI Generator used? -
Have you search for related issues/PRs? -
What's the actual output vs expected output? -
[Optional] Bounty to sponsor the fix (example)
Description
The GENERATOR_HOST
environment variable in openapi-generator-online isn't necessary and can't accurately be set in some cases.
openapi-generator version
all?
OpenAPI declaration file content or url
Command line used for generation
n/a
Steps to reproduce
- Start a docker image and bind all exposed ports to random ports on the host:
docker run -it -P --rm openapitools/openapi-generator-online:v4.0.2
- Observe:
GENERATOR_HOST
would need to be passed atdocker run
, which isn't possible when docker randomizes port assignments. See
Related issues/PRs
#3287
Suggest a fix
Remove GENERATOR_HOST
and pull scheme/host/port from request details.
GENERATOR_HOST
itself adds some other complexity, for example if a single nginx configuration is used to proxy multiple addresses to the same instance of the service (e.g. api.example.com
, example.com
, and latest.example.com
could point to the same service via single nginx configuration, but would all require separate processes due to GENERATOR_HOST
.