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
95 stars 23 forks source link

Bug: ClientSubscriber not generated for some document #49

Closed leejuyuu closed 1 year ago

leejuyuu commented 1 year ago

System Info

Arch Linux go version go1.20.6 linux/amd64 asyncapi-codegen version v0.13.1

Steps to reproduce

  1. Get this AsyncAPI spec https://github.com/derberg/shrekapp-asyncapi-designed/blob/36d42d6c08c0feca49b19fc3d02b2b20bf7f96f1/asyncapi.yaml.
  2. Convert it to 2.6.0 with AsyncAPI studio.
  3. Run asyncapi-codegen on it.
  4. ClientSubscriber contains Chat and TravelStatus methods in api.gen.go.
  5. Now, modify the subscribe operation under /travel/status channel to publish.
  6. Then the ClientSubscriber is completely missing from the generated file.

Expected result

I expected to see the ClientSubscriber contain only Chat in the end.

lerenn commented 1 year ago

Hello @leejuyuu!

Weird thing, I'll investigate this today to see what's wrong , probably in the evening in CEST. I'll keep you updated!

lerenn commented 1 year ago

Fixed in v0.13.3, please read the PR if you want to have more details on why it happened.

Spoiler alert: logic error that never occured to me because I never tested a channel with both 'subscribe' and 'publish' operations.

Don't hesitate to come back to me if necessary.