Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Missing property" is reported for one of required properties #665

Closed
1 of 4 tasks
kazinad opened this issue Feb 20, 2022 · 1 comment
Closed
1 of 4 tasks

"Missing property" is reported for one of required properties #665

kazinad opened this issue Feb 20, 2022 · 1 comment
Labels
Milestone

Comments

@kazinad
Copy link

kazinad commented Feb 20, 2022

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

  • Windows
  • Mac
  • Linux
  • other (please specify)
@kazinad
Copy link
Author

kazinad commented Mar 30, 2022

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants