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.

[json] schema validation in a folder of a workspace stops working when more folders are added to it

See original GitHub issue

Does this issue occur when all extensions are disabled?: Yes

  • VS Code Version: 1.66.2 (Tested in Insiders 1.67.0 with same results)
  • OS Version: Windows 10 Education N x64 - 21H1

Steps to Reproduce:

  1. Create a Workspace and add a simple folder with a schema for JSON files defined in the folder settings. imagen
schema-file.json
{
    "$schema": "http://json-schema.org/draft-07/schema#",
    "title": "Test",
    "description": "An example schema",
    "type": "object",
    "properties": {
        "requiredProperty": {
            "type": "string"
        }
    },
    "required": [
        "requiredProperty"
    ]
}
  1. Check that the test.json file is being validated correctly. imagen

  2. Add a second folder to the workspace. In my test I added an empty folder in the same root as the workspace. The validation still works as expected.

  3. Reload the window or close/open VSCode. The schema validation has stopped working as if the file did not match the fileMatch in the folder settings. Removing the second folder and reloading makes it work again. imagen

As a note, if you open folder-A directly in VSCode rather than the workspace, the validation works as expected.

Issue Analytics

  • State:open
  • Created a year ago
  • Reactions:9
  • Comments:13

github_iconTop GitHub Comments

1reaction
GabenGarcommented, Nov 4, 2022

I noticed this is OS-specific too. On ubuntu 22 machine multi-root validation works fine but on windows 10 machine it doesn’t, on the same codebase.

1reaction
MrVauxscommented, Aug 23, 2022

@ajcool2k Looks fixed in vscode-insiders 1.71

Still have the bug on 1.71 on my machine.

Top: Workspace, Bottom: Folder image

Read more comments on GitHub >

github_iconTop Results From Across the Web

Multiple level nesting in JSON schema validation with sub ...
AJV, the implementation that the tool you're using is a wrapper for, explicitly says that the location of files in the file system...
Read more >
Visual Studio Code Tips and Tricks
Navigate between recently opened folders and workspaces ... .vscode folder. Workspace specific ... Create your own schema and validation in settings.json
Read more >
Project Configuration - Nx
json files are located in each project's folder. Nx merges the two files to get each project's configuration. The following configuration creates build...
Read more >
JSON File - Tableau Help
Note that schema levels in the Select Schema Levels dialog box do not map directly to the folder structure in the Data pane....
Read more >
rush.json
path segment in the "$schema" field for all your Rush config files. ... Rush developers recommend a "category folder" model, where buildable project...
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