Skip to content

[BUG] CLI fails for GitHub URLs with slash-based branches and multi-dot spec files #1940

@akash202004

Description

@akash202004

Describe the bug.

The CLI has two validation bugs causing valid inputs to fail.

1. GitHub URL Parsing

  • Regex assumes branch names do not contain /
  • Fails for valid URLs like:
https://github.com/org/repo/blob/feature/new-validation/spec.yaml
  • Incorrect parsing leads to 404 errors

2. File Extension Detection

  • Uses name.split('.')
  • Fails for:
my.asyncapi.yaml
asyncapi

Expected Behavior

All valid GitHub URLs and specification files should be accepted.

Actual Behavior

Valid inputs are rejected or cause runtime failures.

Expected behavior

Expected behavior

The CLI should correctly accept and process:

  • GitHub file URLs from any valid branch, including branches with slashes (e.g. feature/new-validation)
  • Specification files with multiple dots in the filename (e.g. my.asyncapi.yaml)
  • Filenames without extensions without crashing or behaving unpredictably

Valid inputs should not be rejected during validation.

Screenshots

Screenshots

N/A — this is a validation and parsing logic issue. The failure occurs during URL parsing and file validation, not in the UI.

How to Reproduce

How to reproduce

  1. Run the CLI with a GitHub file URL from a branch containing a slash, for example:
    https://github.com/org/repo/blob/feature/new-validation/spec.yaml
  2. Observe that the CLI fails due to incorrect branch parsing and returns a 404 error.
  3. Run the CLI with a specification file named:
    my.asyncapi.yaml
  4. Observe that the file is rejected due to incorrect extension detection.

🖥️ Device Information [optional]

  • Operating System (OS):
  • Browser:
  • Browser Version:

👀 Have you checked for similar open issues?

  • I checked and didn't find similar issue

🏢 Have you read the Contributing Guidelines?

Are you willing to work on this issue ?

None

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    Status

    To Triage

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions