Skip to content

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

@mosino

Description

@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
#2731

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions