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:
- 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?
🏢 Have you read the Contributing Guidelines?
Are you willing to work on this issue ?
yes
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
🖥️ Device Information [optional]
👀 Have you checked for similar open issues?
🏢 Have you read the Contributing Guidelines?
Are you willing to work on this issue ?
yes