Skip to content

fix: correct GitHub URL branch parsing, multi-dot extensions, and request body validation#2219

Open
Ojas2095 wants to merge 4 commits into
asyncapi:masterfrom
Ojas2095:fix-1940-api
Open

fix: correct GitHub URL branch parsing, multi-dot extensions, and request body validation#2219
Ojas2095 wants to merge 4 commits into
asyncapi:masterfrom
Ojas2095:fix-1940-api

Conversation

@Ojas2095
Copy link
Copy Markdown

Summary

Closes #1940
Closes #1987

This PR addresses two validation bugs that caused valid inputs to be rejected:

1. GitHub URL Parsing & Multi-dot Files (#1940)

  • The convertGitHubWebUrl regex parser has been simplified to return a raw.githubusercontent.com URL natively handling branches containing slashes (/).
  • Replaced fileName.split('.')[1] with path.extname() and parts.pop() in SpecificationFile and file.ts to ensure multi-dot specification files like my.asyncapi.yaml parse securely.

2. Request Body Validation Skip (#1987)

  • In validation.middleware.ts, when compileAjv returns undefined (e.g., for routes with no requestBody such as GET/DELETE), we now correctly call next() instead of throwing a misleading 422 ProblemException.

Testing

  • Verified raw.githubusercontent.com resolution for deeply nested branch names.
  • Tested file creation with multi-dot names.
  • Handled missing request bodies gracefully for GET/DELETE methods.
  • Automated tests passing successfully.

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 28, 2026

🦋 Changeset detected

Latest commit: 64cd5fc

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

@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

1 participant