swagger-core
swagger-core copied to clipboard
Swagger annotations for AsyncAPI
Is Swagger core would be envisaging accepting contribution to support annotations for the Async API specification ?
See https://www.asyncapi.com/
The idea is to fully leverage the Swagger existing capabilities about REST to be applied to Async APIs, with the "io.swagger.v2.aas" package name.
Thanks.
@ludovic-pourrat supporting AsyncAPI is for sure interesting, and any contribution is welcome; unfortunately I think that many modules would need to be implemented alongside the current ones, with some code reuse but also mainly new implementations, e.g. it would need new models, new annotations (even if some could be reused), probably an extended reader at least, as well as model resolver.
Said that, if you have a plan in mind please go ahead, and let me know about any question
@frantuma I am currently sketching out a plan to figure out a design about implementing it, I will submit something for feedback / comments before prototyping it.
Thanks.
Hi,
I have successfully implemented a proof-of-concept to validate this feature within a Spring boot JMS application annotated with Swagger Async annotations and using a dedicated Springdoc implementation for Async.
With this approach, the JMS micro service is capable to expose an endpoint to fetch the generated Async API specification.
Swagger Async Project Definition
Group Id io.swagger.async.v2 Name swagger-async Package io.swagger.v2.aas.annotations Modules
- swagger-annotations
- swagger-models
- swagger-core
- swagger-integration
Links
https://springdoc.org/ https://www.asyncapi.com/
If stepping further, I will coordinate the extension on Springdoc, and referencing of this feature to Async API community.
See Springdoc feature request https://github.com/springdoc/springdoc-openapi/issues/901
Looking forward to feedbacks.
Hi any feedbacks ?
Hi, sorry for late response, missed this. If I get this correctly your plan is to add separate modules for asyncapi within swagger-core or as a separate project as mentioned in your comment, which sounds good I guess; I am not sure if you have anything shareable (as you mention you have a POC), a good way to proceed might be implementing this in a branch/PR and see how it goes. Please let me know what you think
@frantuma works for me that way, I will proceed soon.
hi All, is the asyncAPI implemented? i used the springwolf and there is some mismatch for the discriminator field, which AsyncAPI expecting to have it plain, however swagger 3 is generating object, so, this makes an issue.
AsyncAPI expectation: "discriminator" : "petType"
Swagger API generation as follows: "discriminator": { "propertyName": "petType" }
is there any workaround or option to modify this from swagger object/generation itself?
My Best Regards