-
-
Notifications
You must be signed in to change notification settings - Fork 314
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug.
The AsyncAPI CLI does not support reading an AsyncAPI document from stdin using - as the input path.
When - is provided, the CLI treats it as a literal file path and fails during AsyncAPI file resolution, emitting an error that only lists file paths, URLs, or contexts as valid inputs. This behavior is not documented.
While stdin support is not explicitly documented as supported, - is a widely accepted convention in Unix-style CLIs. The lack of stdin handling breaks common pipeline and automation workflows and forces users to write temporary files to disk, reducing CLI composability and usability in CI and scripting scenarios.
Expected behavior
- If the AsyncAPI file argument is
-, the CLI should read the AsyncAPI document fromstdinand proceed with generation normally. - If stdin input is not supported, the CLI should fail immediately with a clear and explicit error message stating that reading from stdin (
-) is not supported. - The CLI should not attempt file, URL, or context resolution when
-is used as the input argument.
Screenshots
How to Reproduce
- Create an AsyncAPI file (
asyncapi.yaml):
asyncapi: '2.6.0'
info:
title: Stdin test
version: '1.0.0'
channels:
test:
publish:
message:
payload:
type: string- Run the AsyncAPI CLI using stdin as the input source:
asyncapi generate fromTemplate - @asyncapi/html-template -o out < asyncapi.yaml
- Observe that the CLI fails to locate the AsyncAPI document and does not read from stdin, instead showing an error describing only file paths, URLs, or contexts as valid inputs.
🖥️ 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 I am willing to submit a PR!
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working
Type
Projects
Status
To Triage