You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm testing various packages for Async Api documentation and this seems to be the most suited for my purposes, because it works with both OpenApi and AsyncApi patterns.
I kept getting this error trying to generate a document from a AsyncApi 2.0.0 yaml file, while the same function is working fine with my OpenApi 3.0.3 yaml file:
/home/xpto/event-documentation/node_modules/swagger-jsdoc/src/specification.js:173
swaggerObject.paths[property],
^
TypeError: Cannot read property 'asyncapi' of undefined
at organize (/home/xpto/event-documentation/node_modules/swagger-jsdoc/src/specification.js:173:26)
at build (/home/xpto/event-documentation/node_modules/swagger-jsdoc/src/specification.js:316:7)
at module.exports (/home/xpto/event-documentation/node_modules/swagger-jsdoc/src/lib.js:32:10)
at Object.documentation (file:///home/xpto/event-documentation/scopes/documentation/swaggerJsdoc/middlewares.js:49:10)
at file:///home/xpto/event-documentation/scopes/documentation/swaggerJsdoc/index.js:13:43
at ModuleJob.run (internal/modules/esm/module_job.js:183:25)
at Loader.import (internal/modules/esm/loader.js:178:24)
at Object.loadESM (internal/process/esm_loader.js:68:5)
The yaml file is working fine on editors like studio.asyncapi.com and I'm able to serve it with @asyncapi/generator:
asyncapi: 2.0.0info:
title: AsyncAPI Sample Appdescription: This is a sample server.termsOfService: http://asyncapi.org/terms/contact:
name: API Supporturl: http://www.asyncapi.org/supportemail: [email protected]license:
name: Apache 2.0url: http://www.apache.org/licenses/LICENSE-2.0.htmlversion: 1.0.1channels:
user/signedup:
description: This channel is used to exchange messages about users signing upsubscribe:
summary: A user signed up.message:
description: A longer description of the messagepayload:
type: objectproperties:
user:
$ref: "#/components/schemas/user"bindings:
amqp:
is: queuequeue:
exclusive: truecomponents:
schemas:
user:
type: objectrequired:
- nameproperties:
name:
type: stringage:
type: integerformat: int32minimum: 0
So I tried to generating from a .js file, which is most likely the way I'm going to use it, but I get a blank Async API documentation.
This is the .js file I'm trying to generate from:
/** * @asyncapi * user/signedup: * description: This channel is used to exchange messages about users signing up * subscribe: * summary: A user signed up. * message: * description: A longer description of the message * payload: * type: object * properties: * user: * type: object * required: * - name * properties: * name: * type: string * age: * type: integer * format: int32 * minimum: 0 */
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Hello!
I'm testing various packages for Async Api documentation and this seems to be the most suited for my purposes, because it works with both OpenApi and AsyncApi patterns.
I kept getting this error trying to generate a document from a AsyncApi 2.0.0 yaml file, while the same function is working fine with my OpenApi 3.0.3 yaml file:
Here is the way I'm using the package:
The yaml file is working fine on editors like studio.asyncapi.com and I'm able to serve it with @asyncapi/generator:
So I tried to generating from a .js file, which is most likely the way I'm going to use it, but I get a blank Async API documentation.
This is the .js file I'm trying to generate from:
The documentation generated:
Thanks.
The text was updated successfully, but these errors were encountered: