Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • O openapi-generator
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 3,476
    • Issues 3,476
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 402
    • Merge requests 402
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • OpenAPI Tools
  • openapi-generator
  • Issues
  • #3288
Closed
Open
Issue created Jul 06, 2019 by Jim Schubert@jimschubertContributor5 of 6 checklist items completed5/6 checklist items

[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 at docker run, which isn't possible when docker randomizes port assignments. See
image
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.

Assignee
Assign to
Time tracking