swagger-api / swagger-ui

Swagger UI is a collection of HTML, JavaScript, and CSS assets that dynamically generate beautiful documentation from a Swagger-compliant API.
https://swagger.io
Apache License 2.0
26.31k stars 8.91k forks source link

AsyncAPI #6632

Open bufferoverflow opened 3 years ago

bufferoverflow commented 3 years ago

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

mathis-m commented 3 years ago

I have analyzed this a bit further but I am new to AsyncAPI so I have concentrated on the basic integration:

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.

bufferoverflow commented 3 years ago

@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.

Hassen-BENNOUR commented 2 years ago

Hi folks, Any news about this support of AsyncAPI within swagger-ui ? Thanks

char0n commented 2 years ago

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:

image

You can find more information here: https://github.com/swagger-api/swagger-editor/tree/next#using-preview-plugins-in-swaggerui

dgmike commented 1 year ago

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.

ImPacific commented 1 year ago

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:

image

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 ?

image
char0n commented 1 year ago

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.