question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Inconsistent validation based on file extension (file.yml vs file.yaml)

See original GitHub issue

Upon 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:

  1. Open a new workspace.
  2. Set language mode to YAML.
  3. 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
  1. Save file without specifying extension (defaults to .yml)

File > Save > “fileName”

At this point all previously valid syntax reports ‘Incorrect type. Expected “string”.’

  1. 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:closed
  • Created 3 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
vdhcommented, Aug 20, 2020

@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.

0reactions
gorkemcommented, Aug 21, 2020

Extending diagnostics is a good idea opened https://github.com/redhat-developer/yaml-language-server/issues/310

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found