spectral icon indicating copy to clipboard operation
spectral copied to clipboard

feat(rulesets): validate unresolved AsyncAPI document

Open magicmatatjahu opened this issue 1 year ago • 3 comments

Fixes #2261.

Checklist

  • [X] Tests added / updated
  • [X] Docs added / updated

Does this PR introduce a breaking change?

  • [ ] Yes
  • [X] 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,
  }
]

magicmatatjahu avatar Aug 29 '22 13:08 magicmatatjahu

@magicmatatjahu is this ready to be reviewed or do you still need to do some work regarding https://github.com/stoplightio/spectral/pull/2262#discussion_r957380757?

jonaslagoni avatar Sep 13 '22 15:09 jonaslagoni

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

magicmatatjahu avatar Sep 16 '22 11:09 magicmatatjahu

Any update on this one @magicmatatjahu? Or do you want to close it?

jonaslagoni avatar May 22 '23 09:05 jonaslagoni

Closing as stale. Feel free to open if needed. @jonaslagoni

mnaumanali94 avatar May 03 '24 11:05 mnaumanali94