swagger-ui
swagger-ui copied to clipboard
AsyncAPI
Content & configuration
AsyncAPI became quite popular and rendering AsyncAPI's within swagger-ui would be awesome!
From a concept point of view it is very similar to OpenAPI, see https://www.asyncapi.com/docs/getting-started/coming-from-openapi
Are there any plans to add AsyncAPI capabilities to swagger-ui?
Describe the solution you'd like
Support of AsycAPI within swagger-ui
Describe alternatives you've considered
using another tool then swagger-ui, see https://www.asyncapi.com/docs/community/tooling#documentation-generators
Additional context
- GitLab uses swagger-ui to render API specs: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/21106
- I'm of course ready to add similar support for AsyncAPI based filename pattern as with OpenAPI
I have analyzed this a bit further but I am new to AsyncAPI so I have concentrated on the basic integration:
- there is the need for a util that converts AsyncAPI Documents to OAS. I have written a little PoC to test a basic conversion into basic OAS structure.
- Need of a new selector to allow publish and subscribe as valid method to be wrapped via plugin api to support this
- then we could hook into the spec selection process and convert AsyncAPI to OAS spec
- on initial load
- on subtree resolve
Besides that it would need further analysis of AsyncAPI to integrate into the TryOut part. I think for documentation purpose it should be fine to convert the AsyncApi Spec into proper structure.
@mathis-m That's awesome, I'm happy to see this!
@tim-lai What do you think about this approach and in general about support of AsyncAPI within swagger-ui.
Hi folks, Any news about this support of AsyncAPI within swagger-ui ? Thanks
Hi everybody,
Support for rendering AsyncAPI 2.x in SwaggerUI can be achieved by integrating plugins from SwaggerEditor@next. Here is how to achieve that:

You can find more information here: https://github.com/swagger-api/swagger-editor/tree/next#using-preview-plugins-in-swaggerui
Does somebody implements it? I want to use swagger-ui-dist because I don't really need to implement a complex frontend (with React installed or making a pre compiled interface) on my APIs.
Hi everybody,
Support for rendering AsyncAPI 2.x in SwaggerUI can be achieved by integrating plugins from SwaggerEditor@next. Here is how to achieve that:
You can find more information here: https://github.com/swagger-api/swagger-editor/tree/next#using-preview-plugins-in-swaggerui
I tried the solution with plugins in an Angular app but it did not work.
Below is the error I face. Also, when trying to use AsyncApiStandalone component, the types are not available so this seems to be working only for react based apps ?
Does somebody implements it? I want to use swagger-ui-dist because I don't really need to implement a complex frontend (with React installed or making a pre compiled interface) on my APIs.
@dgmike Working on having a separate npm package for this. Will update here when ready.
@ImPacific I've tested just now and it worked as described. I've update the documentation to use swagger-ui instead of swagger-ui-react: https://github.com/swagger-api/swagger-editor/tree/next#using-preview-plugins-in-swaggerui.
I've also added section describing how to achieve standalone mode.