You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
user should be able to pass multiple files to the bundler asyncapi bundler <context-1/filepath1/url1> <context-2/filepath2/url2> <context-3/filepath3/url>3 (getting file from context or filepath or URL is already provided in CLI, you just use load function)
HI @derberg@Souvikns I am Amanpreet a contributor to OpenForce 2022. I would like to work on this issue. I would be making a PR as soon as I am done with resolving the issue. Thank you.
@Souvikns what do you think about the question from @amanbedi1 ? I'm personally not 100% sure but I think non of the files should be considered a base, but simply by default we should put bundled document in the terminal output, and there should also be an option like --output that user could use to specify where to output bundled doc as a file. Thoughts?
I just want to ask in this command the first file passed to command should be base file or not.
bundler takes an array of files but it does not read the files, so you have to read and pass in the content. And base is an option that you can pass. base is for when you want to preserve some schema objects while you are merging multiple separate specifications.
and there should also be an option like --output that user could use to specify where to output bundled doc as a file. Thoughts?
Yeah actually when bundler had a CLI it had a --output but since it is library now it just returns a document object and in the CLI interface we can implement the --output. My thought behind this was since server-api will also integrate bundler it would be easier to just bundle and then send the final document over REST.
I mean there is no way to output a file to a certain directory right now in bundler. It just gives you string and JSON object. So bundler does not care about file system so tools like studio where we do not have access to the file system can also use bundler same goes for server-api which will just send the data over HTTP request.
but this is CLI where we implement bundler option, so CLI should handle the option to output bundler-provided data into a file. Same like server-api will handle sending reply with JSON object. As you wrote, bundler is just to bundle and provide JSON Object (or string) and tools that integrate it, like CLI or Studio or server-api handle rest, like post processing of bundler output.
we just need to remember that this --output flag just like --watcher should be generic, reusable, so other commands can easily use it too, like diff for example
we just need to remember that this --output flag just like --watcher should be generic, reusable, so other commands can easily use it too, like diff for example
Oh now I get you 😄, yeah definitely --output should be reusable.
Hey @derberg@Souvikns I am almost done with bundle command but there is a problem when I try to bundle below files the output is not as expected. So can you guide me how to do this. Files are attached below.
signup.yaml
asyncapi: '2.2.0'
info:
title: Account Service
version: 1.0.0
description: This service is in charge of processing user Signup
channels:
user/signedup:
subscribe:
message:
payload:
type: object
properties:
displayName:
type: string
email:
type: string
format: email
login.yaml
asyncapi: '2.2.0'
info:
title: Account Service
version: 1.0.0
description: This service is in charge of processing user signup
channels:
user/loggenin:
subscribe:
message:
payload:
type: object
properties:
displayName:
type: string
Bundled (terminal) output
asyncapi: '2.2.0',
info: {
title: 'Account Service',
version: '1.0.0',
description: 'This service is in charge of processing user signup'
},
channels: {
'user/signedup': { subscribe: [Object] },
'user/loggenin': { subscribe: [Object] }
}
Expected output
asyncapi: '2.2.0'
info:
title: Account Service
version: 1.0.0
description: This service is in charge for processing user authentication
channles:
user/signedup:
subscribe:
message:
payload:
type: object
properties:
displayName:
type: string
email:
type: string
format: email
user/loggedin:
subscribe:
message:
payload:
type: object
properties:
displayName:
type: string
This issue has been automatically marked as stale because it has not had recent activity 😴
It will be closed in 120 days if no further activity occurs. To unstale this issue, add a comment with a detailed explanation.
There can be many reasons why some specific issue has no activity. The most probable cause is lack of time, not lack of interest. AsyncAPI Initiative is a Linux Foundation project not owned by a single for-profit company. It is a community-driven initiative ruled under open governance model.
Let us figure out together how to push this issue forward. Connect with us through one of many communication channels we established here.
This issue has been automatically marked as stale because it has not had recent activity 😴
It will be closed in 120 days if no further activity occurs. To unstale this issue, add a comment with a detailed explanation.
There can be many reasons why some specific issue has no activity. The most probable cause is lack of time, not lack of interest. AsyncAPI Initiative is a Linux Foundation project not owned by a single for-profit company. It is a community-driven initiative ruled under open governance model.
Let us figure out together how to push this issue forward. Connect with us through one of many communication channels we established here.
Activity
amanbedi1 commentedon Mar 14, 2022
HI @derberg @Souvikns I am Amanpreet a contributor to OpenForce 2022. I would like to work on this issue. I would be making a PR as soon as I am done with resolving the issue. Thank you.
amanbedi1 commentedon Mar 14, 2022
I just want to ask in this command the first file passed to command should be base file or not.
derberg commentedon Mar 14, 2022
@Souvikns what do you think about the question from @amanbedi1 ? I'm personally not 100% sure but I think non of the files should be considered a base, but simply by default we should put bundled document in the terminal output, and there should also be an option like
--outputthat user could use to specify where to output bundled doc as a file. Thoughts?Souvikns commentedon Mar 14, 2022
bundlertakes an array of files but it does not read the files, so you have to read and pass in the content. Andbaseis an option that you can pass.baseis for when you want to preserve someschemaobjects while you are merging multiple separate specifications.Yeah actually when
bundlerhad a CLI it had a--outputbut since it is library now it just returns a document object and in the CLI interface we can implement the--output. My thought behind this was sinceserver-apiwill also integratebundlerit would be easier to just bundle and then send the final document over REST.amanbedi1 commentedon Mar 14, 2022
Ok so I think I just have to output bundled file in terminal or
--outputflag specify where to output bundled doc as a file.I will try to resolve it.
derberg commentedon Mar 14, 2022
what do you mean @Souvikns
Souvikns commentedon Mar 14, 2022
I mean there is no way to output a file to a certain directory right now in
bundler. It just gives you string and JSON object. So bundler does not care about file system so tools likestudiowhere we do not have access to the file system can also usebundlersame goes forserver-apiwhich will just send the data over HTTP request.derberg commentedon Mar 14, 2022
but this is CLI where we implement
bundleroption, so CLI should handle the option to output bundler-provided data into a file. Same likeserver-apiwill handle sending reply with JSON object. As you wrote, bundler is just to bundle and provide JSON Object (or string) and tools that integrate it, like CLI or Studio or server-api handle rest, like post processing of bundler output.we just need to remember that this
--outputflag just like--watchershould be generic, reusable, so other commands can easily use it too, likedifffor exampleSouvikns commentedon Mar 14, 2022
Oh now I get you 😄, yeah definitely
--outputshould be reusable.amanbedi1 commentedon Mar 18, 2022
Hey @derberg @Souvikns I am almost done with bundle command but there is a problem when I try to bundle below files the output is not as expected. So can you guide me how to do this. Files are attached below.
signup.yaml
login.yaml
Bundled (terminal) output
Expected output
Souvikns commentedon Mar 18, 2022
Would be better if you open a WIP PR then I can take a look at your changes, but this is happening most probably because you are using
document.json()that's why you are getting output inJSONformat forYAMLformat you have to usedocument.yml()you can refer this document to learn more https://github.com/asyncapi/bundler/blob/master/API.md#Document+ymlamanbedi1 commentedon Mar 18, 2022
@Souvikns thanks its working.
amanbedi1 commentedon Mar 18, 2022
hey @Souvikns @derberg I just made a PR. Please review it
github-actions commentedon Jul 17, 2022
This issue has been automatically marked as stale because it has not had recent activity 😴
It will be closed in 120 days if no further activity occurs. To unstale this issue, add a comment with a detailed explanation.
There can be many reasons why some specific issue has no activity. The most probable cause is lack of time, not lack of interest. AsyncAPI Initiative is a Linux Foundation project not owned by a single for-profit company. It is a community-driven initiative ruled under open governance model.
Let us figure out together how to push this issue forward. Connect with us through one of many communication channels we established here.
Thank you for your patience ❤️
github-actions commentedon Nov 16, 2022
This issue has been automatically marked as stale because it has not had recent activity 😴
It will be closed in 120 days if no further activity occurs. To unstale this issue, add a comment with a detailed explanation.
There can be many reasons why some specific issue has no activity. The most probable cause is lack of time, not lack of interest. AsyncAPI Initiative is a Linux Foundation project not owned by a single for-profit company. It is a community-driven initiative ruled under open governance model.
Let us figure out together how to push this issue forward. Connect with us through one of many communication channels we established here.
Thank you for your patience ❤️
asyncapi-bot commentedon Mar 30, 2023
🎉 This issue has been resolved in version 0.36.0 🎉
The release is available on:
Your semantic-release bot 📦🚀
s1mrankaur commentedon Feb 16, 2024
@amanbedi1 @Souvikns
My yml file has
$ref: ./components/channels/site-channels.yml#/channels/sites-changeThe bundle command errors out with
ENOENT: no such file or directory,as it doesn't get the path right.
My structure is
and the command was looking for
C:\BLBLA\event-catalog2\components\channels\site-channels.yml'
i.e skipped event-specs folder somehow.