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

References are bundled before validated #405

Closed
Tracked by #481
jonaslagoni opened this issue Nov 10, 2021 · 8 comments
Closed
Tracked by #481

References are bundled before validated #405

jonaslagoni opened this issue Nov 10, 2021 · 8 comments
Labels
bug Something isn't working stale

Comments

@jonaslagoni
Copy link
Sponsor Member

jonaslagoni commented Nov 10, 2021

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.

@jonaslagoni jonaslagoni added the bug Something isn't working label Nov 10, 2021
@jonaslagoni
Copy link
Sponsor Member Author

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

@NektariosFifes
Copy link

@jonaslagoni hey i think i will look this up

@magicmatatjahu magicmatatjahu mentioned this issue Mar 3, 2022
20 tasks
@github-actions
Copy link

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

@github-actions github-actions bot added the stale label Jun 17, 2022
@smoya
Copy link
Member

smoya commented Jun 17, 2022

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

@jonaslagoni jonaslagoni removed the stale label Jun 17, 2022
@github-actions
Copy link

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

@magicmatatjahu
Copy link
Member

Will be fixed by stoplightio/spectral#2262

@github-actions
Copy link

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

@jonaslagoni
Copy link
Sponsor Member Author

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
Labels
bug Something isn't working stale
Projects
None yet
Development

No branches or pull requests

4 participants