Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Studio showing errors that are not really there #887

Closed
derberg opened this issue Dec 11, 2023 · 4 comments
Closed

Studio showing errors that are not really there #887

derberg opened this issue Dec 11, 2023 · 4 comments
Labels
bug Something isn't working

Comments

@derberg
Copy link
Member

derberg commented Dec 11, 2023

Describe the bug

Studio shows errors that are not errors (however strange it sounds). I do know if it is issue related to parser only or some wrong interpretation of parser errors in studio.

How to Reproduce

Open https://studio.asyncapi.com/?url=https://raw.githubusercontent.com/asyncapi/spec/d78dcea70c9b094a3df72f9a4e811828cec778cc/examples/adeo-kafka-request-reply-asyncapi.yml and you will see some errors that you try to investigate but "they are not really there" - I mean they do not really are problems, and do not need to be solved.

There is only one valid issue with this file, lines 242-245

      bindings:
        kafka:
          key:
            $ref: "https://deploy-preview-921--asyncapi-website.netlify.app/resources/casestudies/adeo/CostingResponseKey.avsc"

If you remove above. There are all suddenly no errors anymore and docs get rendered. This issue is related to: asyncapi/spec-json-schemas#466

Expected behavior

I should see that my yaml has error in line 245, that I'm referencing file in wrong format

@derberg derberg added the bug Something isn't working label Dec 11, 2023
@derberg derberg changed the title Studion showing errors that are not really there Studio showing errors that are not really there Dec 11, 2023
@Amzani
Copy link
Collaborator

Amzani commented Dec 12, 2023

@derberg related to parser-js
The diagnostic object looks like this

[
  {
    "code": "asyncapi-document-resolved",
    "message": "\"kafka\" property must match \"then\" schema",
    "path": [
      "components",
      "messages",
      "costingResponse",
      "bindings",
      "kafka"
    ],
    "severity": 0,
    "source": "asyncapi.yaml",
    "range": {
      "start": {
        "line": 268,
        "character": 18
      },
      "end": {
        "line": 270,
        "character": 131
      }
    }
  },
  {
    "code": "asyncapi-document-resolved",
    "message": "\"type\" property must be equal to one of the allowed values: \"array\", \"boolean\", \"integer\", \"null\", \"number\", \"object\", \"string\"",
    "path": [
      "type"
    ],
    "severity": 0,
    "source": "https://deploy-preview-921--asyncapi-website.netlify.app/resources/casestudies/adeo/CostingResponseKey.avsc",
    "range": {
      "start": {
        "line": 2,
        "character": 10
      },
      "end": {
        "line": 2,
        "character": 18
      }
    }
  }
]

@smoya any ideas ? is this related to spectral rules or the parser engine ?

@smoya
Copy link
Member

smoya commented Dec 12, 2023

Im away from keys at this moment, but it seems to me lines are referring to the document after resolving references.

Pending to check, obviously.

@Amzani
Copy link
Collaborator

Amzani commented Feb 16, 2024

ping @smoya

@smoya
Copy link
Member

smoya commented Feb 16, 2024

@Amzani @derberg This issue seems to be fixed now.

@Amzani Amzani closed this as completed Feb 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Archived in project
Development

No branches or pull requests

3 participants