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.

Relative path in inline schema

See original GitHub issue

Summary

I have tried to use the inline syntax to specify a schema file for my yaml. The schema file is in the same directory as the yaml. I have tried to use: # yaml-language-server: $schema=./schema.yaml and # yaml-language-server: $schema=/path/from/.git/folder/schema.yaml

but it does not seem to work.

Is this supposed to be possible?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:3
  • Comments:10 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
JPinkneycommented, Jan 11, 2021

Off the top of my head its probably because you can’t get the workspace root from the yamlSchemaService. I have a PR open that does a big refactoring and should make it possible

1reaction
JPinkneycommented, Dec 10, 2020

Currently, it just supports a url to the schema: # yaml-language-server: $schema=<urlToTheSchema> but I can take a look into supporting local files as well. It shouldn’t be too difficult

Read more comments on GitHub >

github_iconTop Results From Across the Web

using inline schema reference (# yaml-language-server ...
In this example, the schema file lives in the root of the open folder in vscode. Expected Behavior. relative files should work. Current...
Read more >
Relative file path being applied from project directory instead ...
My program reads in a document from a location that is not the project root directory. The doc contains a relative path. When...
Read more >
how to import xsd schema using relative path - CodeRanch
I am working on validating xml using xsd schema. The xml has multiple namespaces so I have to import one xsd schema file...
Read more >
Source Schema (Grid Property) - Microsoft Learn
Most often, the relative path is ".\", indicating that the source schema file resides in the project folder, along with the map file...
Read more >
Using $ref - Swagger
URL Reference – $ref: 'http://path/to/your/resource' Uses the whole document located on the different server. The specific element of the document stored on 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