1

I am thinking of using AsyncAPI in my project for documenting the RabbitMQ messaging system.

What I need to do is, rather than creating a single yaml/json file for all the messages in the application, I want to create the AsyncAPI definition for each message in its own file, very much like its done in Swagger.

I am using Swagger 2.0, on a node express server for the REST API definitions. For the definition of the APIs, I write comments on each API with the @swagger decorator for Swagger to pick up the documentation. For example:

/**
* @swagger
* /user/register:
*   post:
*     description: Register a new user
...
...
*/

I also have a common definition in a routes.js file, where I define all the reusables.

Such definitions sit on the top of each API end point file. Swagger, collects all these documentations distributed over various files, and creates a single documentation for all the APIs in the application.

I was wondering if something similar can be done in AsyncAPI and if yes, how do I achieve that.

Would really appreciate your response on this.

Thanks, Rachit

Rachit Anand
  • 616
  • 5
  • 16

1 Answers1

0

What I need to do is, rather than creating a single yaml/json file for all the messages in the application, I want to create the AsyncAPI definition for each message in its own file, very much like its done in Swagger.

Split definition of schema objects across several files is possible in AsyncAPI exactly in the same way like in OpenAPI

I am using Swagger 2.0, on a node express server for the REST API definitions. For the definition of the APIs, I write comments on each API with the @swagger decorator for Swagger to pick up the documentation. For example:

Up to now there is no code-first tool to generate AsyncAPI from the JS source code

kris13
  • 71
  • 1
  • 4