asyncapi / generator

Use your AsyncAPI definition to generate literally anything. Markdown documentation, Node.js code, HTML documentation, anything!
https://asyncapi.com/docs/tools/generator
Apache License 2.0
767 stars 232 forks source link

Support platform generator type templates to infrastructure as code #1221

Closed emeraldjava closed 5 months ago

emeraldjava commented 5 months ago

Why do we need this improvement?

The idea here that we can extend the existing 'asyncapi generate' command to generate platform commands to create/configure the topics.

How will this change help?

This enables the user to leverage the asyncapi file as a form of infrastructure as code.

Screenshots

No response

How could it be implemented/designed?

On the assumption that kafka is the most popular event broker this enhancement would take the list of topic names from the ayncapi yml file, and output a set of 'kafka' style command to config the needed topics.

kafka-topics.sh --create --topic 'topic-name-per-async-api-yml'

The existing cli supports these two options currently

asyncapi generate fromTemplate ASYNCAPI TEMPLATE
asyncapi generate models LANGUAGE FILE

and i'd foresee a 3rd flavour called 'platform'

asyncapi generate platform ASYNCAPI

which based on the broker type in yml file we'd call the relevant platform-template module.

🚧 Breaking changes

No

👀 Have you checked for similar open issues?

🏢 Have you read the Contributing Guidelines?

Are you willing to work on this issue?

Yes I am willing to submit a PR!

github-actions[bot] commented 5 months ago

Welcome to AsyncAPI. Thanks a lot for reporting your first issue. Please check out our contributors guide and the instructions about a basic recommended setup useful for opening a pull request.
Keep in mind there are also other channels you can use to interact with AsyncAPI community. For more details check out this issue.

emeraldjava commented 5 months ago

As discussed on the slack channel - i opened the proposal issue here. Thanks for the suggestion. @derberg

jonaslagoni commented 5 months ago

makes sense to me :v:

Can easily be extended for multiple protocols 🤙 Remember to add this to the CLI not the generator though 🙂 https://github.com/asyncapi/cli

emeraldjava commented 5 months ago

Let me move the issue to the cli repo and an attempt to start a coded proposal.