Skip to content

Validation shows false negative errors if using boolean with const #1116

@michael-at-mitxp

Description

@michael-at-mitxp

Describe the bug

I have a json schema for autocompletion and validation of yaml files.
Some optional boolean properties may only be true if present.

{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "my-schema",
  "type": "object",
  "properties": {
    "prop": {
      "const": true,
      "type": "boolean"
    }
  }
}
prop: true

Since today it shows the file as invalid if such a property is present, the error message is "Value must be true."
There is a quickfix available with no label but it does not change anything when you select it.

Plugin version is 1.18.0

Expected Behavior

No validation error.

Current Behavior

Shows correct file as invalid.

Steps to Reproduce

see above.

Environment

  • Windows
  • Mac
  • Linux
  • other (please specify)

vscode 1.99.3
windows 11

Metadata

Metadata

Labels

Type

No type

Projects

Status

✅ Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions