Skip to content

feat(rulesets): validate unresolved AsyncAPI document - #2262

Closed
Maciej Urbańczyk (magicmatatjahu) wants to merge 4 commits into
stoplightio:developfrom
magicmatatjahu:asyncapi/refs-validation
Closed

Maciej Urbańczyk (magicmatatjahu) wants to merge 4 commits into
stoplightio:developfrom
magicmatatjahu:asyncapi/refs-validation

Conversation

@magicmatatjahu

@magicmatatjahu Maciej Urbańczyk (magicmatatjahu) commented Aug 29, 2022 •

Copy link
Copy Markdown
Contributor

Fixes #2261.

Checklist

  • Tests added / updated
  • Docs added / updated

Does this PR introduce a breaking change?

  • Yes
  • No

Screenshots

The following AsyncAPI document is invalid and Spectral should throw errors due to invalid defined references (in impossible places):

asyncapi: '2.0.0'
channels: 
  someChannel:
    publish:
      $ref: '#/components/x-operations/someOperation'
components:
  'x-operations':
    someOperation: ...

and Spectral will return errors:

[
  {
    message: 'Referencing here is not allowed',
    path: ['channels', 'someChannel', 'publish', '$ref'],
    severity: DiagnosticSeverity.Error,
  }
]

@jonaslagoni

Copy link
Copy Markdown
Collaborator

Maciej Urbańczyk (@magicmatatjahu) is this ready to be reviewed or do you still need to do some work regarding #2262 (comment)?

@magicmatatjahu

Copy link
Copy Markdown
Contributor Author

Jonas Lagoni (@jonaslagoni) Yeah, when I will find time, I will create PR with uniqueId for schema function.

@jonaslagoni

Copy link
Copy Markdown
Collaborator

Any update on this one Maciej Urbańczyk (@magicmatatjahu)? Or do you want to close it?

@P0lip
Jakub Rożek (P0lip) force-pushed the develop branch 4 times, most recently from 4b6a9e1 to 33deb2b Compare May 23, 2023 20:53
@P0lip
Jakub Rożek (P0lip) force-pushed the develop branch 3 times, most recently from dc9d7f4 to 44c40e2 Compare May 23, 2023 22:56
@P0lip
Jakub Rożek (P0lip) force-pushed the develop branch 4 times, most recently from 02ec0d4 to 84faec8 Compare June 9, 2023 19:43
@P0lip
Jakub Rożek (P0lip) force-pushed the develop branch 3 times, most recently from 9e92f34 to 6d09915 Compare September 20, 2023 18:42
@P0lip
Jakub Rożek (P0lip) force-pushed the develop branch 3 times, most recently from dc90b7a to c22f408 Compare April 4, 2024 13:29
@mnaumanali94

Copy link
Copy Markdown
Contributor

Closing as stale. Feel free to open if needed. Jonas Lagoni (@jonaslagoni)

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

Labels

AsyncAPI Issues related to the AsyncAPI ruleset enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add a rule to validate unresolved AsyncAPI document

4 participants