asyncapi / asyncapi/net-sdk

Make components section usable in case of code-first generation

Open
#72 1 comment 2 reactions 1 assignee Claimed by @cdavernas View on GitHub
area: core good first issue priority: normal type: feature weight: 3
Dominant language
C#
Stars
88
Forks
17
Avg merge
2d 20h
Merged PRs (30d)
2

Description

### What would you like to be added?

In the current version 3.0.6 the code-first approach for generating documents using annotations on c# classes fills out the following sections of the asyncapi v3 specification:
- channels
- operations
That results in the following behavior: Message schemas are directly embedded into the channels.messages section instead of putting them into the components.messages section and referencing them from the channels.messages.

Therefore it would be great if the code-first generator would support a similar functionality as when defining the documents with the FluentBuilder. There it is possible use either "WithMessage" to embed directly or to use "WithMessageComponent" to add the message under components.

### Proposal(s):

Add the same functionality as already used inside of the FluentBuilder into the Generator.

### Alternative(s):

_No response_

### Additional info:

_No response_

### Community Notes

* Please vote by adding a 👍 reaction to the feature to help us prioritize.
* If you are interested to work on this feature, please leave a comment.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.