yaml-language-server icon indicating copy to clipboard operation
yaml-language-server copied to clipboard

"Missing property" is reported for one of required properties

Open kazinad opened this issue 4 years ago • 1 comments

Describe the bug

I have yaml files with a custom schema (see below) where a "Missing property" problem is reported with the extension versions 1.0 and above. Earlier versions worked fine.

exmaple-schema.yml:

# yaml-language-server: $schema=http://json-schema.org/draft-07/schema
$schema: http://json-schema.org/draft-07/schema
type: object
additionalProperties: false
properties:
  columns:
    title: Contains column definitions
    type: object
    patternProperties:
      "^[a-zA-Z]+$":
        title: A column definition
        type: object
        additionalProperties: false
        properties:
          int:
            title: Integer column type
            type: "null"
          long:
            title: Long column type
            type: "null"
          id:
            title: Identity column
            type: "null"
          unique:
            title: Defines single column database unique constraint
            type: "null"
        oneOf:
          - required:
              - int
          - required:
              - long

example.yml:

# yaml-language-server: $schema=./example-schema.yml
columns:
  ColumnA: { int, id }
  ColumnB: { long, unique }
  ColumnC: { int: null, unique}

Expected Behavior

No problems should be reported for "int" and "long" properties. Please note, this works good for "id" and "unique" properties.

Current Behavior

image

Steps to Reproduce

  1. Ensure, newest version is installed of the extension
  2. Save and open the above example files

Environment

  • [X] Windows
  • [ ] Mac
  • [ ] Linux
  • [ ] other (please specify)

kazinad avatar Feb 20 '22 15:02 kazinad

I confirm, the fix is working good with version 1.6 on my machine. Thank you guys! 👍

kazinad avatar Mar 30 '22 14:03 kazinad