event-catalog / generator-asyncapi

AsyncAPI generator for EventCatalog
https://www.eventcatalog.dev/docs/development/integrations/async-api/intro
Other
8 stars 3 forks source link

Generator exports yml when given a spec written in json #36

Open codingnuclei opened 2 days ago

codingnuclei commented 2 days ago

I tried this:

Given

    [
      '@eventcatalog/generator-asyncapi',
      {
        domain: {
          id: 'userManagement',
          name: 'User Management',
          version: '1.0.0',
        },
        services: [
          {
            path: path.join(
              __dirname,
              '../../services/user-management/asyncapi-files',
              'user-service.json',
            ),
          },
        ],
      },
    ]
]

Where user-service.json is a valid asyncAPI JSON schema

This happened:

The schema added to the service in the Catalog is YML in a .json file

I expected this:

The generator should maintain the format given

Is there a workaround?

no :(

Anything else?

Looks like this line is the culprit: https://github.com/event-catalog/generator-asyncapi/compare/eeb5d45..main#diff-a2a171449d862fe29692ce031981047d7ab755ae7f84c707aef80701b3ea0c80R258

EventCatalog Version

No response

Node.js Version

No response

Platform(s)

No response

Community Notes

codingnuclei commented 2 days ago

Apologies - I had just not clicked the button to post 😆

user-service.json