asyncapi / vs-asyncapi-preview

VSCode AsyncAPI Preview Extension
Apache License 2.0
42 stars 36 forks source link

Type array not supported #4

Closed begolf-aci closed 2 years ago

begolf-aci commented 3 years ago

Hi, I came across this bug while trying to use this extension. Here is a sample doc, if you drop it into the asynapi 2.0 playground works fine, but rendering from vcode using the plugin I get the following error: Error: Unable to call the return value of (prop["items"])["properties"], which is undefined or falsey here is the full stack message: Template render error: (c:\Users\ea.vscode\extensions\ivangsa.asyncapi-preview-0.1.1\node_modules\@asyncapi\generator\node_modules\@asyncapi\html-template\template\index.html) Template render error: (c:\Users\ea.vscode\extensions\ivangsa.asyncapi-preview-0.1.1\node_modules\@asyncapi\generator\node_modules\@asyncapi\html-template\partials\content.html) Template render error: (c:\Users\ea.vscode\extensions\ivangsa.asyncapi-preview-0.1.1\node_modules\@asyncapi\generator\node_modules\@asyncapi\html-template\partials\operations.html) Error: Unable to call the return value of (prop["items"])["properties"], which is undefined or falsey

Here is the doc, change the last line from type: array to type: string and it will render find with the extension.... thanks.

asyncapi: 2.0.0
info:
  title: SAMPLE API
  version: 1.1.0
  description: SAMPLE ASYNCAPI spec
servers:
  production:
    url: my.rabbimq
    protocol: amqp
    description: My message broker.
channels:
  txn.authorized:
    publish:
      summary: Publish successful authorized transaction.
      operationId: RTPCE
      message:
        $ref: '#/components/messages/authorize-txn'
components:
  messages:
    authorize-txn:
      payload:
        type: object
        properties:
          message:
            type: object
            $ref: '#/components/schemas/message'
          _version:
            type: string
            description: 'the version of message schema'
            example: 'v7.3'
  schemas:
    message:
      type: object
      properties:
        code:
          type: array
ivangsa commented 3 years ago

ok, thanks @begolf-aci I will try to update asap the extension to the latest playground version Thanks.

github-actions[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity :sleeping:

It will be closed in 120 days if no further activity occurs. To unstale this issue, add a comment with a detailed explanation.

There can be many reasons why some specific issue has no activity. The most probable cause is lack of time, not lack of interest. AsyncAPI Initiative is a Linux Foundation project not owned by a single for-profit company. It is a community-driven initiative ruled under open governance model.

Let us figure out together how to push this issue forward. Connect with us through one of many communication channels we established here.

Thank you for your patience :heart:

derberg commented 2 years ago

will be fixed with https://github.com/asyncapi/vs-asyncapi-preview/pull/47

github-actions[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity :sleeping:

It will be closed in 120 days if no further activity occurs. To unstale this issue, add a comment with a detailed explanation.

There can be many reasons why some specific issue has no activity. The most probable cause is lack of time, not lack of interest. AsyncAPI Initiative is a Linux Foundation project not owned by a single for-profit company. It is a community-driven initiative ruled under open governance model.

Let us figure out together how to push this issue forward. Connect with us through one of many communication channels we established here.

Thank you for your patience :heart:

derberg commented 2 years ago

it should be fixed now