Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AsyncAPI generator is putting services into the user content folder in EventCatalog #27

Open
boyney123 opened this issue Feb 5, 2025 · 1 comment

Comments

@boyney123
Copy link
Contributor

I tried this:

In the examples (currently) the user-service.yml file

import path from 'path';
import url from 'url';

const __dirname = path.dirname(url.fileURLToPath(import.meta.url));

/** @type {import('@eventcatalog/core/bin/eventcatalog.config').Config} */
export default {
  cId: 'f8597068-04ce-4cbc-97d4-ceb18b709fd1',
  title: 'OurLogix',
  tagline: 'A comprehensive logistics and shipping management company',
  organizationName: 'OurLogix',
  homepageLink: 'https://eventcatalog.dev/',
  landingPage: '',
  editUrl: 'https://github.com/boyney123/eventcatalog-demo/edit/master',
  // By default set to false, add true to get urls ending in /
  trailingSlash: false,
  // Change to make the base url of the site different, by default https://{website}.com/docs,
  // changing to /company would be https://{website}.com/company/docs,
  base: '/',
  // Customize the logo, add your logo to public/ folder
  logo: {
    alt: 'EventCatalog Logo',
    src: '/logo.png',
    text: 'OurLogix',
  },
  docs: {
    sidebar: {
      // Should the sub heading be rendered in the docs sidebar?
      showPageHeadings: true,
    },
  },
  generators: [
    [
      '@eventcatalog/generator-asyncapi',
      {
        services: [
          { path: path.join(__dirname, 'asyncapi-files', 'user-service.yml'), id: 'User Service' },
        ],
        domain: { id: 'users', name: 'User', version: '0.0.1' },
        debug: true
      },
    ],
  ],
};

Is getting mapped into the .eventcatalog-core/content/users folder, I think some splitting is done somewhere given the naming clashes here.

To replicate just have this simple user-service.yml file

asyncapi: 3.0.0
info:
  title: User Service
  description: description
  version: 1.1.0

channels:
  randomChannel:
    address: myAddress
    messages:
      UserSignup:
        $ref: '#/components/schemas/UserSignedUp/schema'
operations:
  sendNoise:
    action: send
    channel:
      $ref: '#/channels/randomChannel'
components:
  schemas:
    UserSignedUp:
      schemaFormat: 'application/schema+json;version=draft-07'
      schema:
        '$ref': './user-signed-up.yml#/UserSignedUp'

And import into AsyncAPI generator.

This happened:

Catalog would not load.

I expected this:

Catalog to load and the service to display and info not mapped to the User folder under the hood.

Is there a workaround?

No response

Anything else?

No response

EventCatalog Version

No response

Node.js Version

No response

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.
@boyney123
Copy link
Contributor Author

Looks like it is the domain name?

domain: { id: 'random', name: 'Random', version: '0.0.1' }, works

domain: { id: 'users', name: 'User', version: '0.0.1' }, does not

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant