Skip to content

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

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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