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

Table of contents with AsyncAPIDocumentV3 no operations listed #454

Closed
honnel opened this issue Jan 25, 2024 · 4 comments · Fixed by #523
Closed

Table of contents with AsyncAPIDocumentV3 no operations listed #454

honnel opened this issue Jan 25, 2024 · 4 comments · Fixed by #523
Labels
bug Something isn't working released

Comments

@honnel
Copy link

honnel commented Jan 25, 2024

Describe the bug

Table of contents does not render operations. This is caused by new structure with operations on the same level as channels. Additionally, the checked actions are send and receive and not as expected in TableOfContents with publish and subscribe

How to Reproduce

Steps to reproduce the issue.

Try with this test setup (important is AsyncAPIDocumentV3 as import):

import { render } from '@asyncapi/generator-react-sdk';
import { AsyncAPIDocumentV3 as AsyncAPIDocument } from '@asyncapi/parser';

import { TableOfContents } from '../../components/TableOfContents';

describe('TableOfContents component', () => {
  it('should render toc', () => {
    const asyncapi = new AsyncAPIDocument({
      servers: {
        production: {},
        testing: {},
        canary: {},
      },
      channels: {
        testChannel: {
        }
      },
      operations: {
        testOperation: {
          action: 'send',
          channel: '$ref:#testChannel'
        }
      }
    });
    const expected = `
## Table of Contents

* [Servers](#servers)
  * [production](#production-server)
  * [testing](#testing-server)
  * [canary](#canary-server)
* [Operations](#operations)
  * [PUB testOperation](#pub-testOperation)
`;

    const result = render(<TableOfContents asyncapi={asyncapi} />);
    expect(result.trim()).toEqual(expected.trim());
  });
});

Expected behavior

Test should be green :-)

@honnel honnel added the bug Something isn't working label Jan 25, 2024
Copy link

Welcome to AsyncAPI. Thanks a lot for reporting your first issue. Please check out our contributors guide and the instructions about a basic recommended setup useful for opening a pull request.
Keep in mind there are also other channels you can use to interact with AsyncAPI community. For more details check out this issue.

@korifey91
Copy link
Contributor

The same for me

@derberg
Copy link
Member

derberg commented Apr 8, 2024

@honnel please join review -> #523

@asyncapi-bot
Copy link
Contributor

🎉 This issue has been resolved in version 1.6.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working released
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants