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.

Built in YAML Schemas are not working

See original GitHub issue

Describe the bug

Based on the discovery in https://github.com/redhat-developer/vscode-yaml/issues/392#issuecomment-728380295 it looks like YAML Schemas aren’t validating correctly.

Expected Behavior

Flow-map: !!map { Clark: Evans, Ingy: döt Net, Oren: Ben-Kiki }

should validate without any errors

Current Behavior

Flow-map: !!map { Clark: Evans, Ingy: döt Net, Oren: Ben-Kiki }

has unknown tag tag:yaml.org,2002:map error

Steps to Reproduce

  1. Paste Flow-map: !!map { Clark: Evans, Ingy: döt Net, Oren: Ben-Kiki } into document and observe the errors that occur

Environment

  • Windows
  • Mac
  • Linux
  • other (please specify)

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
gorkemcommented, Apr 23, 2022

Fixed with the new parser

0reactions
Emyrkcommented, Apr 9, 2021

The issue comes from here: https://github.com/redhat-developer/yaml-language-server/blob/master/src/languageservice/utils/parseUtils.ts#L101

Because the schema is passed into the ast library, the default is not used: https://github.com/redhat-developer/yaml-ast-parser/blob/master/src/loader.ts#L171

I think you’d have to extend the default schema with custom tags, rather than creating one from scratch here: https://github.com/redhat-developer/yaml-language-server/blob/master/src/languageservice/utils/parseUtils.ts#L70-L77


I did this in a fork and it works. I’m just not very typescript savy.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to configure YAML schema to make editing files easier
Discover the benefits of providing a YAML schema and how to make it consumable for all of your users, making it easier to...
Read more >
Don't use JSON schema when edition YAML file in Visual ...
How to turn this off and simply use YAML syntax highlighting without specific JSON schema? In the schema selector there is not "No...
Read more >
YAML Schemas: Validating Data without Writing Code
The answer is yes, but the correct choice depends on the language you're working with. Some languages have built-in types that easily map...
Read more >
YAML - Visual Studio Marketplace
Provides comprehensive YAML Language support to Visual Studio Code, via the yaml-language-server, with built-in Kubernetes syntax support.
Read more >
How to create your own auto-completion for JSON and YAML ...
While JSON Schema is designed to work with JSON files, it can be used ... JSON Schema Store is Open source, so why...
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