Skip to content

fix(generate): preserve Windows drive letters in --map-base-url - #2353

Open
Mohit-Gaur75 wants to merge 1 commit into
asyncapi:masterfrom
Mohit-Gaur75:fix/map-base-url-windows-drive
Open

Mohit-Gaur75 wants to merge 1 commit into
asyncapi:masterfrom
Mohit-Gaur75:fix/map-base-url-windows-drive

Conversation

@Mohit-Gaur75

@Mohit-Gaur75 Mohit-Gaur75 commented Nov 21, 2026 •

Copy link
Copy Markdown

Description

Resolves #2348.

mapBaseURLParser previously split <url>:<folder> using greedy regex /(.*):(.*)/g. When an absolute Windows folder path containing a drive letter (such as D:/repo/schemas or D:\repo\schemas) was passed, the split occurred at the colon after the drive letter, stripping the drive letter into the URL and causing resolution failures.

Changes

  • Split at the delimiter colon prior to Windows drive letters to preserve drive letters across forward and backslash paths.
  • Removed greedy regex to avoid ReDoS warnings.
  • Added unit test coverage for Windows drive paths in parseParams.test.ts.
  • Added changeset.

@changeset-bot

changeset-bot Bot commented Nov 21, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: e183c93

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@asyncapi/cli Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-project-automation github-project-automation Bot moved this to To Triage in CLI - Kanban Nov 21, 2026

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Welcome to AsyncAPI. Thanks a lot for creating your first pull request. Please check out our contributors guide useful for opening a pull request.
Keep in mind there are also other channels you can use to interact with AsyncAPI community. For more details check out this issue.

@sonarqubecloud

Copy link
Copy Markdown

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

Labels

None yet

Projects

Status: To Triage

Development

Successfully merging this pull request may close these issues.

[BUG] --map-base-url loses the drive letter of a Windows folder

1 participant