spectral
spectral copied to clipboard
feat(rulesets): validate unresolved AsyncAPI document
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 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 Yeah, when I will find time, I will create PR with uniqueId
for schema function.
Any update on this one @magicmatatjahu? Or do you want to close it?
Closing as stale. Feel free to open if needed. @jonaslagoni