Skip to content

KyleMit/YamlSchemaTestCases

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Test Cases for Yaml Schema Validation

Test cases for vscode-yaml and yaml-language-server comparing validation and syntax highlighting output between JSON and YAML files

Resources & Refernces

Tests

Conditionally Require Field

Conditionally Require Field ... Results

Lang Expected Passed
Yaml Require prop "options"
Json Require prop "options"

screenshot

Conditionally Require Field .... with if...then

"if": {
  "properties": {
    "controlType": {"const": "dropdown"}
  }
},
"then": {
  "required": ["options"]
}

Conditionally Require Field .... with anyOf or oneOf

"oneOf": [
  {
    "properties": {
      "controlType": {"const": "dropdown"}
    },
    "required": ["options"]
  },
  {
    "properties": {
      "controlType": {"const": "button"}
    }
  }
]

Conditionally Add Property

Conditionally Add Property ... Results

screenshot

Lang Expected Passed
Yaml Autocomplete for "options"
Json Autocomplete for "options"

Conditionally Add Property ... with if...then

"if": {
  "properties": {
    "controlType": {"const": "dropdown"}
  }
},
"then": {
  "properties": {
    "options": {
      "type": "array",
      "items": {"type": "string"}
    }
  }
}

Conditionally Add Property ... with anyOf or oneOf

"oneOf": [
   {
     "properties": {
       "controlType": {"const": "dropdown"},
       "options": {
         "type": "array",
         "items": {"type": "string"}
       }
     },
     "required": ["options"]
   },
   {
     "properties": {
       "controlType": {"const": "button"}
     }
   }
 ]

About

Test cases for vscode-yaml

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors