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

EditorPreviewAsyncAPI not rendered for AsyncAPI 3.x.x #5358

Open
Rzepin opened this issue Feb 9, 2025 · 0 comments
Open

EditorPreviewAsyncAPI not rendered for AsyncAPI 3.x.x #5358

Rzepin opened this issue Feb 9, 2025 · 0 comments

Comments

@Rzepin
Copy link

Rzepin commented Feb 9, 2025

Q&A (please complete the following information)

  • OS: Ubuntu
  • Browser: Chrome
  • Version: 132
  • Method of installation: unpkg
  • Swagger-Editor version: 5.0.0-alpha.99
  • Swagger/OpenAPI version: AsyncAPI 3.0.0

Content & configuration

Example Swagger/OpenAPI definition:

asyncapi: 3.0.0
...

e.g. https://raw.githubusercontent.com/asyncapi/spec/refs/heads/master/examples/streetlights-kafka-asyncapi.yml

Swagger-Editor configuration options:

  SwaggerUIBundle({
    url: 'https://raw.githubusercontent.com/asyncapi/spec/refs/heads/master/examples/streetlights-kafka-asyncapi.yml',
    presets: [
      SwaggerUIBundle.presets.apis,
      SwaggerUIStandalonePreset,
    ],
    dom_id: '#swagger-ui',
    plugins: [
      SwaggerEditor.plugins.EditorContentType,
      SwaggerEditor.plugins.EditorPreviewAsyncAPI,
      SwaggerEditor.plugins.EditorPreviewApiDesignSystems,
      SwaggerEditor.plugins.SwaggerUIAdapter,
      SwaggerUIBundle.plugins.DownloadUrl,
    ],
    layout: 'StandaloneLayout',
  });

Describe the bug you're encountering

BaseLayout is rendering EditorPreviewAsyncAPI using selector: selectIsContentTypeAsyncAPI2 altough component would be able to render AsyncAPI 3.x.x as well.

To reproduce...

  1. Try to render any AsyncAPI 3.x.x using StandaloneLayout.
  2. See error: 'Unable to render this definition'.

Expected behavior

Properly rendered definition with EditorPreviewAsyncAPI plugin.

Screenshots

Image

Additional context or thoughts

Btw. current error details are a little bit misleading:

Please indicate a valid Swagger or OpenAPI version field. Supported version fields are swagger: "2.0" and those that match openapi: 3.x.y (for example, openapi: 3.1.0).

Maybe it should be addressed to be changed/improved. In my opinion it would be better to be less specific, but not suggest that only swagger/openapi is supported.

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