Inconsistent validation based on file extension (file.yml vs file.yaml)
See original GitHub issueUpon saving a yaml file as .yml previous valid yaml syntax reports invalid.
Operating System: Windows 10 VS Code Release: 1.43.1 YAML Extension Version: 0.7.2
Steps to reproduce:
- Open a new workspace.
- Set language mode to YAML.
- Insert valid yaml syntax, for example:
plugins:
- name: "Plugin 1"
date: "Mar 21 2020"
licenseKey: |
line1
line2
- name: "Plugin 2"
date: "Mar 21 2020"
licenseKey: |
line1
line2
- Save file without specifying extension (defaults to .yml)
File > Save > “fileName”
At this point all previously valid syntax reports ‘Incorrect type. Expected “string”.’
- Save file specifying the yaml extension.
File > Save as > “fileName.yaml”
All syntax now reports correct again.
Specifically the filename I tested with is “myAppConfig” and follows the exact same formatting as above. It is being saved in the default Windows 10 document folder and using “Spaces 2” indentation. Verified no trailing white space and that both files validate fine with a up to data Python3 yamllint install.
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
Difference between yaml and yml file extension and comparison
This tutorial covers Differences and compares between yaml and yml file extensions.. Yaml files created with yaml and yml file extensions, Both are...
Read more >validation.yml file is ignored - php - Stack Overflow
While validation through annotations works fine, I can't activate validation through validation.yml file. In my app/config/config.yml, ...
Read more >YAML - Wikipedia
YAML (see § History and name) is a human-readable data-serialization language. It is commonly used for configuration files and in applications where data...
Read more >3 YAML tips for better pipelines - GitLab
YAML tip #2: Keep it simple. It's easy to overwhelm the minimalism of a YAML file by including too many details, or by...
Read more >How to Fix Errors in YAML (.YML) Config Files - Knowledgebase
When configuring your server settings, plugins or mods you will typically be editing a .yml file. YAML (Yet Another Markup Language) uses the...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@JPinkney Which schema file…? This is the issue.
Other linters like ESLint or Typescript will identify themselves in the Problems pane, and directly link to their validation source (ESLint with external doc links, or TS with error codes).
vscode-yaml
is anonymous and lacking any info to trace which schema is complaining, thereby making it impossible to find false-positives and fix them.Extending diagnostics is a good idea opened https://github.com/redhat-developer/yaml-language-server/issues/310