cli
cli copied to clipboard
[BUG] The bundle command does not bundle referenced files
trafficstars
Describe the bug.
The CLI tool now accepts asyncapi bundle for v3 documents (thanks to fix of issue https://github.com/asyncapi/cli/issues/1137). However, it does not work as I expected, but of course I could be missing something.
I created a new default document with asyncapi new and moved the single message to a file in the same directory. Added a $ref in the main file. When I ran asyncapi bundle main.yaml on the new file, I expected it to merge the “message file”. But it didn’t.
main.yaml
asyncapi: 3.0.0
info:
title: Account Service
version: 1.0.0
description: This service is in charge of processing user signups
channels:
userSignedUp:
address: user/signedup
messages:
UserSignedUp:
$ref: '#/components/messages/UserSignedUp'
operations:
onUserSignUp:
action: receive
channel:
$ref: '#/channels/userSignedUp'
messages:
- $ref: '#/channels/userSignedUp/messages/UserSignedUp'
components:
messages:
UserSignedUp:
$ref: './messages.yaml#/UserSignedUp'
messages.yaml
UserSignedUp:
payload:
type: object
properties:
displayName:
type: string
description: Name of the user
email:
type: string
format: email
description: Email of the user
Expected behavior
One yaml file containing the whole specification.
expected_bundle.yaml
asyncapi: 3.0.0
info:
title: Account Service
version: 1.0.0
description: This service is in charge of processing user signups
channels:
userSignedUp:
address: user/signedup
messages:
UserSignedUp:
$ref: '#/components/messages/UserSignedUp'
operations:
onUserSignUp:
action: receive
channel:
$ref: '#/channels/userSignedUp'
messages:
- $ref: '#/channels/userSignedUp/messages/UserSignedUp'
components:
messages:
UserSignedUp:
payload:
type: object
properties:
displayName:
type: string
description: Name of the user
email:
type: string
format: email
description: Email of the user
Screenshots
How to Reproduce
- Extract
main.yamlandmessages.yamlto the same directory - In that directory, execute
asyncapi bundle main.yaml
🥦 Browser
None
👀 Have you checked for similar open issues?
- [X] I checked and didn't find similar issue
🏢 Have you read the Contributing Guidelines?
- [X] I have read the Contributing Guidelines
Are you willing to work on this issue ?
None