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
  • #8576
Closed
Open
Issue created Jan 29, 2021 by Administrator@rootContributor0 of 6 checklist items completed0/6 checklist items

[BUG][typescript-fetch] Base Path can't be set to relative path

Created by: mosino

Bug Report Checklist

  • Have you provided a full/minimal spec to reproduce the issue?
  • Have you validated the input using an OpenAPI validator (example)?
  • Have you tested with the latest master to confirm the issue still exists?
  • Have you searched for related issues/PRs?
  • What's the actual output vs expected output?
  • [Optional] Sponsorship to speed up the bug fix or feature request (example)
Description

When the server url is set to a relative path, in the generated source files it will be prefixed with "https://localhost"

openapi-generator version

latest

OpenAPI declaration file content or url
"servers": [
    {
      "url": "/my-api"
    }
  ]
Generation Details

openapi-generator-cli generate --skip-validate-spec --input-spec ./my-api.json --generator-name typescript-fetch --output gen/my-api --config my-api-config.json

my-api-config.json

{
  "npmName": "my-api",
  "npmVersion": "1.0.0",
  "snapshot": false,
  "supportsES6": false,
  "modelPropertyNaming": "original"
}
Steps to reproduce

Run the above command on a yaml file with server url set to a relative path

Related issues/PRs

#2731 (closed) #2731 (closed)

Assignee
Assign to
Time tracking