Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add readme generation to the js websocket client #1350

Open
derberg opened this issue Jan 29, 2025 · 1 comment
Open

add readme generation to the js websocket client #1350

derberg opened this issue Jan 29, 2025 · 1 comment
Labels
enhancement New feature or request

Comments

@derberg
Copy link
Member

derberg commented Jan 29, 2025

at the moment template https://github.com/asyncapi/generator/tree/master/packages/templates/clients/js/websocket/template only generates client.js. But the person that uses generator should also get a README.md file with explanation on how to use the generated client.

this README.md of course need to be properly templated. It will have few things static, but in the readme you want to generate a list of API, available functions that client gives you - this is dynamic info, one AsyncAPI doc can have 2 another 3 operations.

here is a hardcoded example of how somebody would use the client, in this case for Postman Websocket Echo: https://github.com/asyncapi/generator/blob/master/packages/templates/clients/js/websocket/example.js. This example pretty much shows what info you need as dev, if you want to use generated client.

In repo there is also AsyncAPI document for Hoppscotch public Websocket API. Try to generate client for it, and try to use it without looking into example.js

@derberg derberg converted this from a draft issue Jan 29, 2025
@derberg derberg added the enhancement New feature or request label Jan 29, 2025
@sharvarii1
Copy link

Hey @derberg!
I’m interested in working on this issue. I’m a newbie, but I’d love to contribute! From what I understand, to solve this issue, we need to create a README.md.njk file that includes both static and dynamically generated content.
To get the dynamic information, we need to iterate over the channels and their operations in the AsyncAPI document to extract details about the available API methods. This will ensure that the generated README provides clear usage instructions for the client.
Does this approach sound correct? Any guidance would be appreciated!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Todo
Development

No branches or pull requests

2 participants