redocly-cli
redocly-cli copied to clipboard
Improve error output for this case, invalid rule fails
https://github.com/Redocly/redocly-cli/blob/35fd19861dadc6670cfe724ed22e3944dda0b38d/packages/core/src/rules/common/assertions/utils.ts#L88
How can we improve this error output? Is there some way to reference the rule that is failing?
The extension completely fails when this error is encountered, is there a way to log the error but continue validation? The other option may be to output a notification in VS Code for those users.
I incorrectly used the property keyword with defined: true and a sibling disallowed assertion on this rule. changing it to required: ["get"] and removing property fixes the issue
rules:
rule/paths-meta-must-only-define-get-operation:
severity: error
message: '"/meta" MUST only define a GET operation'
subject:
type: PathItem
matchParentKeys: /\/meta$/
property: get
assertions:
defined: true
disallowed:
- post
- put
- patch
- delete
openapi: 3.0.4
info:
title: test
version: 1.0.0
paths:
'/thing/meta':
delete:
summary: thing meta
responses:
'204':
description: No Content
Thank you for reporting the issue.