Skip to content

Conversation

@sahillllllllll-bit
Copy link
Contributor

Description

  • Adds an explicit validation check for empty AsyncAPI files in the generate fromTemplate command.
  • Prevents the CLI from crashing with a raw JavaScript TypeError when the AsyncAPI document is empty.
  • Returns an existing, user-friendly ValidationError (invalid-file) instead.

Related issue(s)

Fixes #1993

before

TypeError: Cannot read properties of undefined (reading 'asyncapi')

After

Error: Invalid AsyncAPI file provided: empty.yaml

@changeset-bot
Copy link

changeset-bot bot commented Jan 30, 2026

⚠️ No Changeset found

Latest commit: 32b7262

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

@AayushSaini101
Copy link
Collaborator

/u

@AayushSaini101
Copy link
Collaborator

@sahillllllllll-bit thank you for the contribution can please fix the test build : )

@sahillllllllll-bit
Copy link
Contributor Author

@sahillllllllll-bit thank you for the contribution can please fix the test build : )

Thank you for the review! 😊
I’m fixing the test build now and will push the updated changes shortly.

@sahillllllllll-bit sahillllllllll-bit force-pushed the fix/empty-asyncapi-file-clean branch from 02b268a to 32b7262 Compare January 30, 2026 12:13
@sonarqubecloud
Copy link

@sahillllllllll-bit
Copy link
Contributor Author

@sahillllllllll-bit thank you for the contribution can please fix the test build : )

Thanks! All checks are now passing. Please let me know if anything else is needed

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] CLI crashes with TypeError when AsyncAPI document file is empty

2 participants