-
Notifications
You must be signed in to change notification settings - Fork 57
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
[FEATURE] Generate classes based on AsyncAPI document #207
Comments
To be honest, I didn't understand anything, sorry) Can you describe your idea in more detail? |
So the idea would be to package a source generator as a standalone nuget package which a user can install. As part of the csproj the user specifies the yaml file and on build/compile time classes are generated as per the asyncapi spec. This approach would enable asyncapi to be the source of truth for schema ie contract first rather than code first. |
I'm implementing a Roslyn source generator for a PoC on a work project. This will be my first source generator, so I'm also playing with it in my personal time. My idea is two-fold:
I'm also planning of implementing Swagger (IApiDescriptionProvider) on top of on AsyncApi schema for the "Try it out" functionality for easy message creation for testing and debugging. |
Update: I've both code generators working for our project. Not in a state yet it will be generally usable, but all necessary components are working. But it highly depends on #213, since I first generate interfaces decorated with the AsyncApi attributes based of AsyncApi spec file(s). (Using NSwag for the data-types + custom code gen for the asyncApi channels using the Lego.asyncApi.reader for parsing the spec files) I'm willing to make it production ready if this saunter project starts moving again. |
…ncremental build should be working now)
…n for AsyncApi document info
Why do we need this improvement?
Allow for less boiler plate to code to be prepared.
How will this change help?
Enable classes to be generated at build time based on AsyncAPI document.
Screenshots
No response
How could it be implemented/designed?
By using dotnet source generators and provide a standalone package
🚧 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!
The text was updated successfully, but these errors were encountered: