Skip to content

fix: correctly get file extension for multi-dot filenames like my.asyncapi.yaml#2208

Open
hikali123456789 wants to merge 2 commits into
asyncapi:masterfrom
hikali123456789:fix-fileexists-multi-ext
Open

fix: correctly get file extension for multi-dot filenames like my.asyncapi.yaml#2208
hikali123456789 wants to merge 2 commits into
asyncapi:masterfrom
hikali123456789:fix-fileexists-multi-ext

Conversation

@hikali123456789
Copy link
Copy Markdown

Description

The ileExists() function in SpecificationFile.ts incorrectly extracts file extensions using split('.')[1], which only works for single-dot filenames like ile.txt but fails for multi-dot filenames like my.asyncapi.yaml.

Example

  • ile.txt ? extension extracted as xt ?
  • my.asyncapi.yaml ? extension extracted as �syncapi ? (should be yaml)

Fix

Changed the extension extraction logic to use slice(1).join('.') which correctly captures all parts after the first dot, or to use lastIndexOf('.') approach to get the last extension.

PR-Merge

Please add the �ounty label and the shipit / hacktoberfest-accepted label if applicable. Thank you!

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 21, 2026

⚠️ No Changeset found

Latest commit: a7a5f2d

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

@hikali123456789
Copy link
Copy Markdown
Author

Hi! This PR is ready for review. The fix handles multi-dot filenames correctly. Let me know if any changes needed.

@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.

1 participant