{"id":15907112,"url":"https://github.com/kylemit/yamlschematestcases","last_synced_at":"2026-04-30T15:33:14.467Z","repository":{"id":71746437,"uuid":"204531270","full_name":"KyleMit/YamlSchemaTestCases","owner":"KyleMit","description":"Test cases for vscode-yaml","archived":false,"fork":false,"pushed_at":"2022-02-13T16:59:41.000Z","size":3,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-04-14T15:05:17.934Z","etag":null,"topics":["demo-app","json-schema","yaml"],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/KyleMit.png","metadata":{"files":{"readme":"ReadMe.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-08-26T17:56:17.000Z","updated_at":"2021-11-26T22:50:43.000Z","dependencies_parsed_at":"2023-02-22T13:46:23.748Z","dependency_job_id":null,"html_url":"https://github.com/KyleMit/YamlSchemaTestCases","commit_stats":{"total_commits":4,"total_committers":1,"mean_commits":4.0,"dds":0.0,"last_synced_commit":"1075594dae360b5d1768545e4716657c9301575d"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/KyleMit/YamlSchemaTestCases","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KyleMit%2FYamlSchemaTestCases","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KyleMit%2FYamlSchemaTestCases/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KyleMit%2FYamlSchemaTestCases/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KyleMit%2FYamlSchemaTestCases/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/KyleMit","download_url":"https://codeload.github.com/KyleMit/YamlSchemaTestCases/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KyleMit%2FYamlSchemaTestCases/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31976805,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-18T16:27:12.723Z","status":"ssl_error","status_checked_at":"2026-04-18T16:27:11.140Z","response_time":103,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["demo-app","json-schema","yaml"],"created_at":"2024-10-06T14:00:37.530Z","updated_at":"2026-04-30T15:33:14.449Z","avatar_url":"https://github.com/KyleMit.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# Test Cases for Yaml Schema Validation\n\nTest cases for [vscode-yaml](https://github.com/redhat-developer/vscode-yaml) and [yaml-language-server](https://github.com/redhat-developer/yaml-language-server) comparing validation and syntax highlighting output between JSON and YAML files\n\n## Resources \u0026 Refernces\n\n* Spec\n  * [6.6 Keywords for Applying Subschemas Conditionally](http://json-schema.org/latest/json-schema-validation.html#rfc.section.6.6)\n  * [6.7 Keywords for Applying Subschemas With Boolean Logic](http://json-schema.org/latest/json-schema-validation.html#logic)\n\n* Guides\n  * [Applying subschemas conditionally](https://json-schema.org/understanding-json-schema/reference/conditionals.html)\n  * [Combining schemas](https://json-schema.org/understanding-json-schema/reference/combining.html)\n  * [Schema Dependencies](https://json-schema.org/understanding-json-schema/reference/object.html#schema-dependencies)\n\n* Stack Overflow\n  * [JsonSchema - conditionally require attribute](https://stackoverflow.com/a/38781027/1366033)\n\n## Tests\n\n### Conditionally Require Field\n\n### Conditionally Require Field ... Results\n\n| Lang | Expected               | Passed |\n| ---- | ---------------------- | ------ |\n| Yaml | Require prop \"options\" | ✅     |\n| Json | Require prop \"options\" | ✅     |\n\n![screenshot](https://i.imgur.com/p8sNT7n.png)\n\n### Conditionally Require Field .... with  `if...then`\n\n```json\n\"if\": {\n  \"properties\": {\n    \"controlType\": {\"const\": \"dropdown\"}\n  }\n},\n\"then\": {\n  \"required\": [\"options\"]\n}\n```\n\n### Conditionally Require Field .... with `anyOf` or `oneOf`\n\n```json\n\"oneOf\": [\n  {\n    \"properties\": {\n      \"controlType\": {\"const\": \"dropdown\"}\n    },\n    \"required\": [\"options\"]\n  },\n  {\n    \"properties\": {\n      \"controlType\": {\"const\": \"button\"}\n    }\n  }\n]\n```\n\n## Conditionally Add Property\n\n### Conditionally Add Property ... Results\n\n![screenshot](https://i.imgur.com/HmWFCjY.png)\n\n| Lang | Expected                   | Passed |\n| ---- | -------------------------- | ------ |\n| Yaml | Autocomplete for \"options\" | ❌     |\n| Json | Autocomplete for \"options\" | ✅     |\n\n### Conditionally Add Property ... with  `if...then`\n\n```json\n\"if\": {\n  \"properties\": {\n    \"controlType\": {\"const\": \"dropdown\"}\n  }\n},\n\"then\": {\n  \"properties\": {\n    \"options\": {\n      \"type\": \"array\",\n      \"items\": {\"type\": \"string\"}\n    }\n  }\n}\n```\n\n### Conditionally Add Property ... with `anyOf` or `oneOf`\n\n```json\n\"oneOf\": [\n   {\n     \"properties\": {\n       \"controlType\": {\"const\": \"dropdown\"},\n       \"options\": {\n         \"type\": \"array\",\n         \"items\": {\"type\": \"string\"}\n       }\n     },\n     \"required\": [\"options\"]\n   },\n   {\n     \"properties\": {\n       \"controlType\": {\"const\": \"button\"}\n     }\n   }\n ]\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkylemit%2Fyamlschematestcases","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkylemit%2Fyamlschematestcases","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkylemit%2Fyamlschematestcases/lists"}