Skip to content
This repository has been archived by the owner on Feb 5, 2025. It is now read-only.

Generator creates an empty channel by default - breaks the rendering #23

Closed
IsmaelMartinez opened this issue Jan 17, 2025 · 2 comments · Fixed by #24
Closed

Generator creates an empty channel by default - breaks the rendering #23

IsmaelMartinez opened this issue Jan 17, 2025 · 2 comments · Fixed by #24

Comments

@IsmaelMartinez
Copy link
Contributor

I tried this:

I used the generator to create events that link to a service.

This generates by default an empty channel. I believe then eventcatalog assumes there is no channel associated, so it doesn't link them together.

This happened:

Example of the frontmatter generated

---
id: id
name: name
version: '1'
schemaPath: name-openapi.json
badges:
  - content: 'Source: name'
    backgroundColor: pink
    textColor: pink
  - content: 'DetailType: undefined'
    backgroundColor: pink
    textColor: pink
  - content: 'Schema name: name'
    backgroundColor: pink
    textColor: pink
channels: [] <----
---
## Overview

This then fails to render the "lines" in the graph.

I expected this:

Expected to render correctly in the UI, and/or to have a 'eventbridge' channel.

Is there a workaround?

You can remove the "channels: []" section in each event and then it renders fine.

Anything else?

No response

EventCatalog Version

2.19.3

Node.js Version

v22.10.0

Platform(s)

No response

Community Notes

  • Please vote by adding a 👍 reaction to the issue to help us prioritize.
  • If you are interested to work on this issue, please leave a comment.
@IsmaelMartinez
Copy link
Contributor Author

I believe this line

let eventChannel = [] as any;
is the culpit as we should only add channels if there are any. Otherwise the rendered thinks there is a channel of communication (that is empty).

I will see if I can do a PR later today to fix that area and allow for setting that as null if there aren't any channels.

@IsmaelMartinez
Copy link
Contributor Author

I have created a PR with the fix for this and the detailType (that was showing as undefined).

Both are conditional and should not break previous implementations. This is probably related to us using a custom schema registry instead of the autodiscovery one.

boyney123 added a commit that referenced this issue Feb 5, 2025
…ls-if-there-are-none

fix(channels): only adding channels into the service when there are to fix #23
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
1 participant