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

Can't suggest object correctly with certain schema definition. #769

Closed
1 task
chuyangguangshin opened this issue Aug 23, 2022 · 0 comments · Fixed by #785
Closed
1 task

Can't suggest object correctly with certain schema definition. #769

chuyangguangshin opened this issue Aug 23, 2022 · 0 comments · Fixed by #785
Assignees
Milestone

Comments

@chuyangguangshin
Copy link

chuyangguangshin commented Aug 23, 2022

Describe the bug

Can't suggest object correctly with certain schema definition.

Schema used in the demo:

{
  "$schema": "http://json-schema.org/draft-07/schema",
  "type":"object",
  "oneOf": [
    {
      "additionalProperties": false,
      "properties": {
        "A" : {
          "type":"string"
        }
      },
      "required": [
        "A"
      ]
    },
    {
      "additionalProperties": false,
      "properties": {
        "B" : {
          "type":"string"
        }
      },
      "required": [
        "B"
      ]
    }
  ]
}

Expected Behavior

It should suggest A and B while the yaml is empty as version yaml-language-server 0.23.0 does.
image

Current Behavior

It only suggest A when yaml-language-server 1.9.1 installed
image

Not only in empty file. It will not suggest all possible objects at some child node position with the schema provided .

Steps to Reproduce

  1. Config yaml to verify with the schema provided.
  2. Trig suggestion on a empty yaml.

Environment

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