event-catalog / sdk

JS/TS SDK for EventCatalog
https://eventcatalog.dev/docs/sdk
7 stars 4 forks source link

Adding multiple services with the same version to a domain will result in one service per version #47

Closed debae closed 1 month ago

debae commented 1 month ago

I tried this:

We made a custom generator which leverages the SDK to generate a complete catalog. However we encounter an issue when adding multiple services to a domain.

This happened:

When adding multiple services to a domain with the same version number, only one service get's added correctly

await addServiceToDomain("MyDomain", { service : "ServiceOne", version: "1.0.0" })
await addServiceToDomain("MyDomain", { service : "ServiceTwo", version: "1.0.0" })

So in the index.md for the domain this results in :

services:
  - service: ServiceOne
    version: 1.0.0

I expected this:

Every service should be added to the domain and resulting in :

services:
  - service: ServiceOne
    version: 1.0.0
  - service: ServiceTwo
    version: 1.0.0

Is there a workaround?

When using different versions of the services it is working correctly.

Anything else?

No response

EventCatalog Version

@eventcatalog/sdk@1.0.0

Node.js Version

v20.16.0

Platform(s)

MacOS

Community Notes

debae commented 1 month ago

My bad, the syntax of the service was wrong and should be

await addServiceToDomain("MyDomain", { id : "ServiceOne", version: "1.0.0" })
await addServiceToDomain("MyDomain", { id : "ServiceTwo", version: "1.0.0" })