lerenn / asyncapi-codegen

An AsyncAPI Golang Code generator that generates all Go code from the broker to the application/user. Just plug your application to your favorite message broker!
Apache License 2.0
89 stars 23 forks source link

Fix generation from channel that have both subscription and publication #52

Closed lerenn closed 1 year ago

lerenn commented 1 year ago

When trying to generate a channel with a subscribe and a publish operation, only one of them is generated due to a if and else if in the file pkg/asyncapi/specification.go: in GetPublishSubscribeCount() function: when the first operation is catched by the first if, it doesn't check the second due to the else in the else if.

This correct the else if into a if and adds a test to assure non-regression.