Giter VIP home page Giter VIP logo

vs-asyncapi-preview's Introduction

Marketplace Version Marketplace Downloads

AsyncAPI Preview

Preview AsyncAPI documents inside VSCode.

AsyncAPI Preview was simplified and reworked from scratch to use the latest @asyncapi/asyncapi-react, removing old dependencies on Express, socket.io and js-yaml with better startup performance and bundle size.

You can open AsyncAPI Preview from the editor title/context menu. (If you don't see that button, you can use shift+command+P to open command palette and select Preview AsyncAPI.)

AsyncAPI Preview

Automatic hot-reloading

Automatic hot-reloading on editor save, but currently, it doesn't reload when saving referenced external files.

Content Assistance

Available snippets:

Open an empty or otherwise yaml file and start typing one of the following prefixes, you may need to press Ctrl+space to trigger autocompletion in some cases:

  • add asyncapi skeleton: Adds an asyncapi skeleton for jump starting your API editing.
  • add asyncapi subscribe to async request: Inserts a new subscribe operation, for listening to incoming async requests/commands.
  • add asyncapi publish event operation: Inserts a new publish operation, for producing domain events.
  • add asyncapi message: Inserts a new message, you can choose it to be either a Request or an Event.

Once snippets are inserted use the <TAB> key to travel between snippet placeholders.

Paste as Schema

You can also autogenerate an Schema object from a JSON example.

Right-click inside #/components/schemas section and choose AsyncAPI: Paste as Schema from the context menu.

VSCode AsyncapiPreview - Content Assistance

Credits

AsyncAPI Viewer utilizes the following open source projects:

Contributors

Ivan Garcia Sainz-Aja ivangsa

vs-asyncapi-preview's People

Contributors

asyncapi-bot avatar codingtenshi avatar derberg avatar fmvilas avatar ivangsa avatar luotianchun avatar magicmatatjahu avatar nikhilkalburgi avatar savio629 avatar smoya avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

vs-asyncapi-preview's Issues

Need for urgent changes in GitHub Actions automation

This issue defines a list of tasks that need to be performed in this repo to make sure it's ci/cd automation works long term without any issues.

It is up to maintainers to decide if it must be addressed in one or multiple PRs.

Below are 3 different sections describing 3 different important ci/cd changes.

IMPORTANT-START
For GitHub workflows that contain This workflow is centrally managed in https://github.com/asyncapi/.github/ you do not have to perform any work. These workflows were already updated through the update in .github. The only exception is the workflows related to nodejs release. More details in Upgrade Release pipeline - in case of nodejs projects section
IMPORTANT-END

Deprecation of way data is shared between steps

Every single GitHub Action workflow that has echo "::set-output name={name}::{value}" need to be updated to follow echo "{name}={value}" >> $GITHUB_OUTPUT

We do not yet know when set-output will stop working. Previous disable date was 31.05 but now then say community needs more time.

For more details read official article from GitHub

Deprecation of node12

2nd bullet point is still relevant for you even if your projects in not nodejs project

  • Every single workflow that uses setup-node action needs an update to follow v3 version of this action, and make sure minimum node 14 is used
  • Now this part is more complex. Problem with node12 is that node-based GitHub Actions were using it in majority as a runtime environment. Look for example at this action.yaml file for setup-node action v2. So the job that you have to do is go through all the workflows, and verify every single action that you use, make sure you are using the latest version that is not based on node12. I already did review a lot of actions as part of this PR so maybe you will find some actions there and can copy from me. For example action/checkout needs to be updated to v3.

Node12 end of support in action is probably September 27th.

For more details read official article from GitHub

Upgrade Release pipeline - in case of nodejs projects

ignore this section if your project is not nodejs project

You have 2 options. You can:

A. choose to switch to new release pipeline using instruction from asyncapi/.github#205

B. stay with old release pipeline, and manually update GitHub workflows and actions used in it, you can inspire a lot from this PR asyncapi/.github#226

I definitely recommend going with A

Workflows related to release:

  • .github/workflows/if-nodejs-release.yml
  • .github/workflows/if-nodejs-version-bump.yml
  • .github/workflows/bump.yml

Extension causes high cpu load

ivangsa.asyncapi-preview-unresponsive.cpuprofile.txt

  • Issue Type: Performance
  • Extension Name: asyncapi-preview
  • Extension Version: 0.1.1
  • OS Version: Darwin x64 20.4.0
  • VS Code version: 1.56.0

⚠️ Make sure to attach this file from your home-directory:
⚠️/var/folders/1w/_43ql7tx5vz8ln45w16f55t40000gn/T/ivangsa.asyncapi-preview-unresponsive.cpuprofile.txt
ivangsa.asyncapi-preview-unresponsive.cpuprofile.txt

Find more details here: https://github.com/microsoft/vscode/wiki/Explain-extension-causes-high-cpu-load

VS Code + WSL: Command 'Preview AsyncAPI' resulted in an error

Describe the bug

When using from within WSL on Windows 10, I get the following error:

image

How to Reproduce

Steps to reproduce the issue:

  • in VS Code, open a project from inside WSL that contains an AsyncAPI spec
  • in VS Code, open the AsyncAPI spec document
  • in VS Code, open the command palette and select "Preview AsyncAPI"

Expected behavior

I expect the preview to show a preview of the AsyncAPI spec document

Add SmartPaste functionality to editor

Reason/Context

Adding SmartPaste command and/or keybinding will allow to generate asyncapi snippets from user clipboard, for instance:

  • creating a new #/components/schema object from a json payload example
  • creating headers/traits from a json object representing real headers

Description

  • How could it be implemented/designed?

Considering use https://github.com/aspecto-io/genson-js

Type array not supported

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

Version 0.2 doesn't open relative reference

Describe the bug

Impossible to open an existing reference to an external file

How to Reproduce

components:
messages:
ProspectMessage:
contentType: application/json
description: This is a message notification when a sample is created
headers:
$ref: "../Dictionary/flow.openapi.yaml#/components/schemas/MyHeader"
payload:
..
=> Preview AsyncAPI
Error:
Error: Error downloading https://file+.vscode-resource.vscode-cdn.net/c%3A/projects/pm2/Dictionary/flow.openapi.yaml HTTP ERROR 401

Expected behavior

Work with asyncapi-preview v0.1.1

image

JSON Schema preview is broken

Describe the bug

If I try to preview a JSON schema file which has no connection to AsyncAPI, I get a white page with black text that says only:

Error: The asyncapi field is missing.

How to Reproduce

Create a file test.schema.json with the following content:

{"$schema": "https://json-schema.org/draft-07/schema"}

Then click the "Preview AsyncAPI" button or Cmd+Shift+P (macOS) and select the option.

Screenshot 2023-09-27 at 18 22 38

This appears to be identical to this issue from a similar plugin for IDEA.

Expected behavior

Either the preview option should be unavailable (because it doesn't work on this file type) or, even better, I should see a nice overview of the schema (assuming it was not trivial, like the example I gave).

Rendering doesn't appear correct when a "reply:" is included in an operation.

The rendering seems to be getting it wrong when "reply:" is present in an operation definition.

Operation OnBlockRun1 is a SEND yet it is rendered as RECEIVE.
Operation OnBlockRun2 is rendered correctly.

Also, the "REPLY INFORMATION" block is rendering the request channel rather than the reply channel.

Note, I also observed this behavior in Asyncapi Studio.

image

`asyncapi: 3.0.0
info:
title: demonstrate defect
version: 1.0.0
description: description

channels:
Block:
address: device.v1.request.{id}.block
messages:
BlockSend:
$ref: '#/components/messages/Block'
BlockReply:
address: device.v1.reply.{id}.block
messages:
BlockReturn:
$ref: '#/components/messages/BlockReply'

operations:
onBlockRun1:
action: send
channel:
$ref: '#/channels/Block'
messages:
- $ref: '#/channels/Block/messages/BlockSend'
reply:
address:
location: '$message.header#/ReplyTo'
channel:
$ref: '#/channels/BlockReply'
messages:
- $ref: '#/channels/BlockReply/messages/BlockReturn'
onBlockRun2:
action: send
channel:
$ref: '#/channels/Block'
messages:
- $ref: '#/channels/Block/messages/BlockSend'

components:
schemas:
BlockIdentifier:
description: Uniquely identifies a block, important for run, clear and hold actions.
type: object
properties:
Id:
type: string
format: guid
Name:
type: string
HeaderBody:
type: object
properties:
SpanId:
description: The span identifier for OpenTelemetry. Typically this would be a guid.
type: string
ReplyTo:
description: The url to send the reply message to. This is only valid for request messages.
type: string

messageTraits:
MessageBase:
headers:
$ref: '#/components/schemas/HeaderBody'
correlationId:
description: The span identifier for OpenTelemetry.
location: $message.header#/SpanId

messages:
Block:
traits:
- $ref: '#/components/messageTraits/MessageBase'
payload:
type: object
properties:
Identifier:
$ref: '#/components/schemas/BlockIdentifier'
Action:
type: string
description: valid values:- clear | run | hold
BlockReply:
payload:
type: object
properties:
Identifier:
$ref: '#/components/schemas/BlockIdentifier'
Action:
type: string
description: valid values:- clear | run | hold

parameters:
id:
description: The ID of the device`

Some channel names generate errors in VS Extension but work in AsyncAPI Studio

Describe the bug

Hello! I've created some async api document with real channel names we use in out project in the online AsyncAPI Studio (https://studio.asyncapi.com). It works perfectly, but then I load the same document into VS Code with the extension installed, I receive the following errors and preview is not shown:

6.TestChannel?Content-Type=application/json;charset=utf-8 channel contains invalid name with url query parameters: ?Content-Type=application/json;charset=utf-8

I understand that channel name looks weird, but we can not change it at least fast...

The same document is shown correctly in AsyncAPI Studio:
изображение

How to Reproduce

Sample async api document to reproduce the issue:

asyncapi: 2.6.0
info:
  title: Test Service
  version: 1.0.0
channels:
  TestChannel?Content-Type=application/json;charset=utf-8:
    publish:
      message:
        $ref: '#/components/messages/TestMessage'
components:
  messages:
    TestMessage:
      contentType: application/json
      description: test message model

Expected behavior

Preview is shown as in the official online tool

Does not work on macOS

Today I found this extension and that was inspiring due to exceptions, I already using Swagger Viewer. But unfortunately it works only on linux, which would be fine, but I use macOS mainly. The only thing I see when I open a viewer is black message:

Cannot GET /file//Users/.../asyncapi.yml

I've tried to play around, but did not find quick solution.

HTTP message binding version 0.3.0 produces empty screen

Describe the bug.

When using https://github.com/asyncapi/bindings/blob/master/http/README.md#message
Preivew doesn't render anything.

Expected behavior

Proper AsyncAPI HTLM rendered.

Screenshots

image

How to Reproduce

Create AsyncAPI document with following content

asyncapi: 3.0.0
info:
  title: test
  version: 0.1.0
components:
  messages:
    myMessage:
      bindings:
        http:
          bindingVersion: 0.3.0
          statusCode: 202

🥦 Browser

None

👀 Have you checked for similar open issues?

  • I checked and didn't find similar issue

🏢 Have you read the Contributing Guidelines?

Are you willing to work on this issue ?

No, someone else can work on it

AsyncAPI do not support version of 2.1.0

first,i came across the same question like #4, i want write a list of list or a array of array, so i try solve it in 2..1.0, write code like this
recomm_station: type: array items: type: array items: - type: number description: '' - type: number description: '' - type: number description:''
and i solve the problem , it can work ok in https://playground.asyncapi.io/ ,but i comes error when i use it in vscode by AsyncAPI Preview ,the error as follow
Template render error: (/home/uisee/.vscode/extensions/ivangsa.asyncapi-preview-0.1.1/node_modules/@asyncapi/generator/node_modules/@asyncapi/html-template/template/index.html) Template render error: (/home/uisee/.vscode/extensions/ivangsa.asyncapi-preview-0.1.1/node_modules/@asyncapi/generator/node_modules/@asyncapi/html-template/partials/content.html) Template render error: (/home/uisee/.vscode/extensions/ivangsa.asyncapi-preview-0.1.1/node_modules/@asyncapi/generator/node_modules/@asyncapi/html-template/partials/operations.html) Error: Unable to callthe return value of (prop["items"])["properties"], which is undefined or falsey

Migrate package-lock.json file to version 2

Reason/Context

Parser-JS requires now Node.js 14 and npm7 or higher.
This means package-lock.json version should be always set to 2.

Description

In order to unify development requirements, I suggest all repositories to stick with that requirements. In order to do that, the following is needed:

  • Clarify this requirement under Development section on this repository README file.
  • To update package-lock.json to version 2. This is automatically done when running npm install if the npm version used is 7 or higher.

Related:

Scroll position not preserved on reload in preview page

Describe the bug

Scroll position not preserved on reload in preview page.
It should remember the section the user is using and when it reloads it should render back to the same section.

Screenshots

test.yml.-.extension.-.Visual.Studio.Code.2023-03-30.20-08-15.mp4

Expected behavior

When user saves the file and it reloads, then it should render back to the same section the user was previewing.

Error: TypeError: The "path" argument must be of type string. Received undefined

Describe the bug

👋 Hey there, thanks for all the hard work on this extension! I'm seeing the following error when I attempt to open a preview using command+shift+p.

2022-11-27 09:56:40.704 [error] TypeError: The "path" argument must be of type string. Received undefined
	at new NodeError (node:internal/errors:371:5)
	at validateString (node:internal/validators:120:11)
	at Object.dirname (node:path:1276:5)
	at a (/home/leigh/.vscode/extensions/asyncapi.asyncapi-preview-0.4.0/dist/extension.js:1:179602)
	at /home/leigh/.vscode/extensions/asyncapi.asyncapi-preview-0.4.0/dist/extension.js:1:181584
	at process.processTicksAndRejections (node:internal/process/task_queues:96:5)
	at async s._executeContributedCommand (/snap/code/113/usr/share/code/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:92:111367) asyncapi.preview {"value":"asyncapi.asyncapi-preview","_lower":"asyncapi.asyncapi-preview"}

VS Code version:

Version: 1.73.1
Commit: 6261075646f055b99068d3688932416f2346dd3b
Date: 2022-11-09T03:54:53.913Z
Electron: 19.0.17
Chromium: 102.0.5005.167
Node.js: 16.14.2
V8: 10.2.154.15-electron.0
OS: Linux x64 5.15.0-53-generic snap
Sandboxed: No

How to Reproduce

  1. Open an async API schema

  2. Press control+shift+p or command+shift-p to open commands

  3. Select Preview AsyncAPI command

  4. I'm getting prompted to open an AsyncAPI file, even though I already have one open in VS Code. I verified my schema is valid via https://studio.asyncapi.com/
    Screenshot from 2022-11-27 10-00-28

  5. After selecting the Async API schema again (even though it's already open in my editor), I'm seeing the following error:
    Screenshot from 2022-11-27 10-03-28

In VSCode's Output under Log (Extension Host) I see the following error:

2022-11-27 10:05:00.129 [error] TypeError: The "path" argument must be of type string. Received undefined
	at new NodeError (node:internal/errors:371:5)
	at validateString (node:internal/validators:120:11)
	at Object.dirname (node:path:1276:5)
	at a (/home/leigh/.vscode/extensions/asyncapi.asyncapi-preview-0.4.0/dist/extension.js:1:179602)
	at /home/leigh/.vscode/extensions/asyncapi.asyncapi-preview-0.4.0/dist/extension.js:1:181584
	at process.processTicksAndRejections (node:internal/process/task_queues:96:5)
	at async s._executeContributedCommand (/snap/code/113/usr/share/code/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:92:111367) asyncapi.preview {"value":"asyncapi.asyncapi-preview","_lower":"asyncapi.asyncapi-preview"}

Maybe the extension is unable to find an executable named asyncapi? Unsure how to proceed or how this should be sandboxed. Thanks for looking into this! 🙇‍♀️

Expected behavior

File preview opens in a new panel.

Text Overflow

Describe the bug

A clear and concise description of what the bug is.

How to Reproduce

Steps to reproduce the issue. Attach all resources that can help us understand the issue:

  • Decrease the width of the preview.

Screenshots

test.yml.-.extension.-.Visual.Studio.Code.2023-03-30.20-06-09.mp4

Expected behavior

A clear and concise description of what you expected to happen.

  • The text that is overflowing should be continued on the next line.

Add "Autofix" feature for common linting errors (w/ spectral)

AsyncAPI-Preview + Spectral for VSCode form a perfect combo interms of UX/DX for asyncapi editing:

  • with this extension you can navigate and preview your API definition
  • while Spectral for VSCode provides inline and listed linting error for common and even custom mistakes

VSCode comes with an API for providing quick/autofixes for linting errors (see https://code.visualstudio.com/docs/editor/refactoring https://code.visualstudio.com/api/references/vscode-api#CodeActionProvider and https://github.com/microsoft/vscode-extension-samples/tree/main/code-actions-sample for an example)

The pourpose of this feature is to provide autofix refactoring for most common and standard spectral linting errors for asyncapi:
https://docs.stoplight.io/docs/spectral/1e63ffd0220f3-async-api-rules

Implementation

Phase One:

Phase Two:

  • Investigate how to load autofix rules from external files
  • External autofix rule files could support also custom (non-standard) spectral linting rules

Add Snippets to VSCode for Content Assistance

Reason/Context

Snippets/Content Assistenace will improve user experience and jump start edition asyncapi definition documents.

Description

Will provide snippets for:

  • Creating an asyncapi skeleton
  • Adding a new Subscribe operation
  • Adding a new Publish operation
  • Adding a new Message

Undefined error when preview on external browser

It works fine to preview inside VS Code, but if I set preview on external browser, the error notification pop up:

Unable to open 'undefined': Unable to read file '/undefined' (Error: Unable to resolve non-existing file '/undefined').

The error log in Developer Tool Console:

mainThreadExtensionService.ts:66 TypeError: Cannot read property 'document' of undefined
at /home/user/.vscode/extensions/ivangsa.asyncapi-preview-0.0.3/out/extension.js:78
at l.fire (/snap/code/52/usr/share/code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:46)
at t.ExtHostDocuments.$acceptDirtyStateChanged (/snap/code/52/usr/share/code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:735)
at t.ExtHostDocuments.$acceptModelSaved (/snap/code/52/usr/share/code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:735)
at m._doInvokeHandler (/snap/code/52/usr/share/code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:892)
at m._invokeHandler (/snap/code/52/usr/share/code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:892)
at m._receiveRequest (/snap/code/52/usr/share/code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:891)
at m._receiveOneMessage (/snap/code/52/usr/share/code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:890)
at /snap/code/52/usr/share/code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:888
at l.fire (/snap/code/52/usr/share/code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:46)
at v.fire (/snap/code/52/usr/share/code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:233)
at /snap/code/52/usr/share/code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:1094
at l.fire (/snap/code/52/usr/share/code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:46)
at v.fire (/snap/code/52/usr/share/code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:233)
at t.PersistentProtocol._receiveMessage (/snap/code/52/usr/share/code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:238)
at /snap/code/52/usr/share/code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:235
at l.fire (/snap/code/52/usr/share/code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:46)
at p.acceptChunk (/snap/code/52/usr/share/code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:231)
at /snap/code/52/usr/share/code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:230
at Socket.t (/snap/code/52/usr/share/code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:240)
at Socket.emit (events.js:223)
at addChunk (_stream_readable.js:309)
at readableAddChunk (_stream_readable.js:290)
at Socket.Readable.push (_stream_readable.js:224)
at Pipe.onStreamRead (internal/stream_base_commons.js:181)
$onExtensionRuntimeError @ mainThreadExtensionService.ts:57
notificationsAlerts.ts:40 Unable to open 'undefined': Unable to read file '/undefined' (Error: Unable to resolve non-existing file '/undefined').

The version I'm using:

ivangsa.asyncapi-preview
v0.0.3

VS Code
Version: 1.52.1
Commit: ea3859d4ba2f3e577a159bc91e3074c5d85c0523
Date: 2020-12-16T16:32:10.090Z
Electron: 9.3.5
Chrome: 83.0.4103.122
Node.js: 12.14.1
V8: 8.3.110.13-electron.0
OS: Linux x64 5.4.0-62-generic snap

Support AsyncAPI encoded in JSON

Reason/Context

Please try answering few of those questions

  • Why we need this improvement?
    It appears the current version of this extension only interprets YAML files. AsyncAPI can also be encoded in JSON format.

  • How will this change help?
    We will be able to use this extension to view AsyncAPIs whether encoded in YAML or JSON

  • What is the motivation?
    To offer full support for the AsyncAPI standard

Description

Please try answering few of those questions

  • What changes have to be introduced?
    At minimum, look for JSON files with the proper header -- and then offer to the user to use the preview

  • Will this be a breaking change?
    I hope not

  • How could it be implemented/designed?
    Haven't a clue. I've never implemented a VSCode extension.

Thank you for your help!

AsyncAPI spec v3 support in VS code preview

Reason/Context

This Issue is used to track changes needed to support AsyncAPI v3. As a code owner, please edit this list of TODO tasks in order to properly track the progress 🙂 Once this issue is closed it means that v3 is now fully supported in this library.

Remaining tasks:

@ivangsa I am basically guessing here what is needed to support AsyncAPI v3, feel free to redo the entire list 😄

Outdated tutorial guides https://www.asyncapi.com/docs/tools/generator/generator-template

In the tutorial it has this snippet

class TemperatureServiceClient:

  def __init__(self):
              self.client = mqtt.Client()
              self.client.connect(mqttBroker)

But this would throw an error because the python in this case now requires a callback api version specification. I researched further on how to fix and found out the the python client packages offer two version for api call back and any can be used in this case

CallbackAPIVersion.VERSION2
or
CallbackAPIVersion.VERSION1

so the fixed code should look something like this

class TemperatureServiceClient:

  def __init__(self):
              self.client = mqtt.Client(CallbackAPIVersion.VERSION2)
              self.client.connect(mqttBroker)

Components Schemas, Messages: Multiple level arrays not rendered completely.

The following yaml snippet demonstrates object arrays not being rendered completely. Note, this type of construct will render correctly in OpenAPI.

asyncapi: 3.0.0
info:
title: Show defect Service
version: 1.0.0
description: This message payload structures are not rendered completely
components:
schemas:
BlockItem:
description: An item in a block.
type: object
properties:
Id:
type: string
format: guid
Name:
type: string
messages:
Add:
description: Block item structure is only expanded for non array property
payload:
type: object
properties:
BlockItem:
$ref: '#/components/schemas/BlockItem'
BlockItems:
type: array
Items:
$ref: '#/components/schemas/BlockItem'

yaml formatting lost so file attached.
asyncapi.yaml.txt
Screenshot asyncapi defect

Error in yaml file are no longer reported

Describe the bug

Since version 0.6 the errors in the file are no longer reported.
Before parsing errors were shown in the preview window, now the preview is empty.

How to Reproduce

Following file

asyncapi: 2.6.0
info:
title: Message
version: "0.1.0"

Output in previous version:
image

Output in new version:
image

Expected behavior

Errors should be reported.

Docs are unreadable

Describe the bug

Docs are unreadable. See screenshot.

How to Reproduce

Not sure how to reproduce it. I'm using the Material Theme, which is probably changing the default color.

Captura de Pantalla 2022-08-30 a las 11 02 58


This problem should probably be addressed at the AsyncAPI React component. If we make sure this is covered there, it won't be a problem here or in any other editor.

Modify extension usage in README.md

Reason/Context

Please try answering few of those questions

  • Why we need this improvement?
    This extensive is no longer working from context menu, users need to use other methods.
  • How will this change help?
    Show user how to use it by updating README.md.
  • What is the motivation?
    I was confused when I first installed it, and it didn't work as I expected.

Description

Please try answering few of those questions

  • What changes have to be introduced?
    Show correct way in README.md.
  • Will this be a breaking change?
    Nope.
  • How could it be implemented/designed?
    Just modify the README.md file.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.