Skip to content

References are bundled before validated #405

Closed

Description

@jonaslagoni

Describe the bug

Currently, the parser bundles any references together with the provided AsyncAPI document before it's validated against the JSON Schema document for AsyncAPI.

This results in invalid AsyncAPI documents being valid.

How to Reproduce

Given the following AsyncAPI document:

asyncapi: '2.2.0'
info:
  title: Test overriding dereferenced objects 
  version: '1.0.0'
servers:
  test:
    $ref: 'testServer.yaml'

Together with the server file:

url: ws://mycompany.com/ws
protocol: ws

The parser accepts the AsyncAPI document as being valid because we bundle the reference together with the document, before it is validated.

The spec however does not allow that servers to be referenced: https://www.asyncapi.com/docs/specifications/v2.2.0#serversObject

NOTE: You cannot try this in the studio because it automatically validates beyond what the parser does, so the studio catches such mistakes.

Activity

  1. added
    bug
    on Nov 10, 2021
  2. jonaslagoni commented on Nov 10, 2021

    @jonaslagoni
    MemberAuthor

    Not quite sure about this, but solving this might also solve #404, as additional properties would not be allowed in most cases.

  3. NektariosFifes commented on Feb 16, 2022

    @NektariosFifes

    @jonaslagoni hey i think i will look this up

  4. github-actions commented on Jun 17, 2022

    @github-actions

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

    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 ❤️

  5. smoya commented on Jun 17, 2022

    @smoya
    Member

    @jonaslagoni could you remove the stale label? I think is still relevant. Also @NektariosFifes said it will work on it. Thanks!

  6. github-actions commented on Oct 16, 2022

    @github-actions

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

    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 ❤️

  7. magicmatatjahu commented on Nov 15, 2022

    @magicmatatjahu
    Member

    Will be fixed by stoplightio/spectral#2262

  8. github-actions commented on Mar 16, 2023

    @github-actions

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

    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 ❤️

  9. jonaslagoni commented on May 22, 2023

    @jonaslagoni
    MemberAuthor

    Closing, as it was changed in #720

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugstale

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions