-
-
Notifications
You must be signed in to change notification settings - Fork 310
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug.
When running the AsyncAPI CLI with an empty AsyncAPI file, the CLI crashes with a raw JavaScript TypeError instead of showing a user-friendly validation error.
Expected behavior
The CLI should detect that the AsyncAPI file is empty and return a clear error message, such as:
The provided AsyncAPI file is empty or invalid.
Screenshots
How to Reproduce
- Create an empty AsyncAPI file:
touch empty.yaml
- Create a minimal valid generator template:
mkdir -p test-template/template
cat > test-template/package.json <<EOF
{
"name": "test-template",
"version": "1.0.0",
"generator": ">=2.0.0"
}
EOF
echo "test" > test-template/template/test.txt
- Run the AsyncAPI CLI:
asyncapi generate fromTemplate empty.yaml ./test-template -o out
🖥️ Device Information [optional]
- Operating System (OS): Windows(WSL)
- Browser:
- Browser Version:
👀 Have you checked for similar open issues?
- I checked and didn't find similar issue
🏢 Have you read the Contributing Guidelines?
- I have read the Contributing Guidelines
Are you willing to work on this issue ?
yes
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working
Type
Projects
Status
To Triage