parser-js icon indicating copy to clipboard operation
parser-js copied to clipboard

Dereference error does not include "title"

Open tim-lai opened this issue 3 years ago • 2 comments
trafficstars

Describe the bug

The dereferencing parser is not returning definition.refs.title, which is expected per ParserError.

How to Reproduce

  1. Go to https://studio.asyncapi.com/
  2. Introduce two $ref errors as seen in screenshot, e.g. line 32 and line 39.
  3. Expand the Problems pane

asyncapi-parser-deref-error

Expected behavior

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

In the screenshot, one can see that the title referencing line 39 is incorrect. It should be Token "lightmeasured3" does not exist.

This visual error is because definition.title is being used instead of definition.refs[].title, but more importantly is that I can observe that definition.refs[].title itself doesn't exist as an output of the parser.

tim-lai avatar Jun 06 '22 17:06 tim-lai

Welcome to AsyncAPI. Thanks a lot for reporting your first issue. Please check out our contributors guide and the instructions about a basic recommended setup useful for opening a pull request.
Keep in mind there are also other channels you can use to interact with AsyncAPI community. For more details check out this issue.

github-actions[bot] avatar Jun 06 '22 17:06 github-actions[bot]

Hey thanks for reporting that bug. I could reproduce the error. I think, using the correct error index, will resolve the following issue.

https://github.com/asyncapi/parser-js/blob/c962a7e7278f5fc8652621d8881032fceaa79a28/lib/parser.js#L162

imabp avatar Jul 10 '22 13:07 imabp

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:

github-actions[bot] avatar Nov 08 '22 00:11 github-actions[bot]

It is resolved in the https://github.com/asyncapi/studio/pull/434

magicmatatjahu avatar Nov 08 '22 09:11 magicmatatjahu