Improve error output for this case, invalid rule fails
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 1.5k
- Forks
- 228
- Avg merge
- 1d 14h
- Merged PRs (30d)
- 48
Description
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
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at packages/core/src/rules/common/assertions/utils.ts:88 and reproduce the failure with the rule and OpenAPI example in the issue. Trace how the invalid assertion error is reported and determine a clear completion criterion for identifying the failing rule and handling validation without the extension failing.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- openapi, typescript
- Domain
- api, tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100