Closed jelleVandendriessche closed 1 year ago
I can confirm that this is an issue for us as well
I ran your example. It generated 2 events:
---
name: deliveryEvent
summary: null
version: 1.0.0
producers:
- ResultsDataService
consumers: []
externalLinks: []
badges: []
---
<NodeGraph />
<Schema />
---
name: '<anonymous-message-2>'
summary: null
version: 1.0.0
producers: []
consumers:
- ResultsDataService
externalLinks: []
badges: []
---
<NodeGraph />
<Schema />
As far as I understand it, this is because the DeliveryCreatedConsumer message doesn't have a name, so the AsyncAPI generator considers it a different event.
You could change your specification, to:
delivery-event:
publish:
operationId: DeliveryCreatedConsumer
summary: Updates deliverymapfeatures using Delivery event
message:
$ref: '#/components/messages/deliveryEvent'
The generator now realises it is the same message, but interprets it as a different version. So it generates:
events/deliveryEvent
├── index.md
├── schema.json
└── versioned
└── 1.0.0
├── index.md
└── schema.json
This is not the expected behaviour.
Thanks @jelleVandendriessche for raising the issue and others helping out.
I made a new test and fix for this and managed to get it working with your test AsyncAPI file you provided. @jelleVandendriessche when you get a chance you could test again when the package is released (Just doing that now).
Fix has gone out @eventcatalog/plugin-doc-generator-asyncapi
version 0.3.2
, let me know if it works OK, thanks again!
Works like a charm!
Awesome! Enjoy
Have you read the Contributing Guidelines on issues?
Description
I have an API that is both consumer and producer of an event. But when using the generator it only fills in the producers field. The consumers fields is left empty.
Other events where the service is only a consumer work fine.
Steps to reproduce
Expected behavior
The service is added both as a consumers as a producer.
Actual behavior
Your environment