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

$refs to other files cause the OpenAPI and AsyncAPI viewers to break #814

Open
hukhuk opened this issue Sep 17, 2024 · 0 comments
Open

$refs to other files cause the OpenAPI and AsyncAPI viewers to break #814

hukhuk opened this issue Sep 17, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@hukhuk
Copy link

hukhuk commented Sep 17, 2024

I tried this:

I set up a service with both an OpenAPI and an AsyncAPI file, both sharing a common payload -file. I then setup the generators for both, ran generate, and went browsing.

This happened:

The discovery pieces work fine and the schema is displayed on the event -page, but following the OpenAPI spec or AsyncAPI spec -links at the service level cause issues.

OpenAPI:
image

AsyncAPI:
image

I expected this:

No response

Is there a workaround?

Not using $refs to other files and duplicating the schemas instead.

Anything else?

Attached is the folder with the spec files.

spec.zip

Platform is wsl2 (ubuntu).

And the generator config:

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 {
  title: 'EventCatalog',
  tagline: 'Discover, Explore and Document your Event Driven Architectures',
  organizationName: 'asd',
  homepageLink: 'https://eventcatalog.dev/',
  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: 'EventCatalog'
  },
  docs: {
    sidebar: {
      // Should the sub heading be rendered in the docs sidebar?
      showPageHeadings: true
    }
  },
  generators: [
    [
      '@eventcatalog/generator-asyncapi',
      {
        services: [
          { path: path.join(__dirname, 'spec', 'asyncapi', 'items.yml'), },
        ],
        domain: { id: 'items', name: 'Items', version: '0.0.1' },
        debug: true
      },
    ],
    [
      '@eventcatalog/generator-openapi',
      {
        path: [
          path.join(__dirname, 'spec', 'openapi', 'items-openapi.yml'),
        ],
        domain: { id: 'items', name: 'Items', version: '0.0.1' },
        debug: true,
      }
    ],
  ],
  // required random generated id used by eventcatalog
  cId: '81302fa4-bfcb-4c26-8e41-4b075aa59b67'
}

EventCatalog Version

@eventcatalog/[email protected]

Node.js Version

v20.17.0

Platform(s)

Linux

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.
@hukhuk hukhuk added the bug Something isn't working label Sep 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant