Open AayushSaini101 opened 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.
Makes sense, taget next
@AayushSaini101 :v:
I just stumbled over this. I ran asyncapi generate models
and end up with:
Successfully generated the following models: AnonymousSchema1, AnonymousSchema25, AnonymousSchema28, AnonymousSchema31, AnonymousSchema38, AnonymousSchema41, AnonymousSchema44
I would've expected that the file name as well as the class name do use the actual name of the component / message / whatevs. Is there currently no way or do I have to set some extra annotation somewhere?
Happy to accept and help guide a PR π Otherwise, yes, explicit annotations is the workaround
What annotation would that be?
This would be a breaking change, right?
Any idea where to start? I imagined this to be an easy change but grepping for anonymous
yields only CommonModel and AsyncAPIInputProcessor apart from the tests / examples. It's not apparent to me where AnonymousSchema_N gets generated.
What annotation would that be?
You would have to explicitly define the message payload as the name of the message.
This would be a breaking change, right?
Yes, just target the next
branch π Unless you want to hide it behind an option.
Any idea where to start? I imagined this to be an easy change but grepping for anonymous yields only CommonModel and AsyncAPIInputProcessor apart from the tests / examples. It's not apparent to me where AnonymousSchema_N gets generated.
All this logic happens in the input processor for AsyncAPI: https://github.com/asyncapi/modelina/blob/9f9fc78e40bf1efcc64d73d03085de75d6012976/src/processors/AsyncAPIInputProcessor.ts#L128
Why do we need this improvement?
Asyncapi.yml:
Output:
How will this change help?
This change will help to adhere proper naming of the project, lets suppose if we want to call the model class we need to call the AnonymousSchema_1 which seems to be not valid.
Screenshots
No response
How could it be implemented/designed?
π§ 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!