Skip to content

Unable to load relative path JSON schema for YAML validation #30938

@rudolfvesely

Description

@rudolfvesely

Summary

Unable to load relative path JSON schema for YAML validation

Zed is fantastic! Thank you!

Description

  • It is possible to configure an absolute path for JSON schema when validating YAML.
  • It is not possible to load a relative path.

Steps to reproduce:

  • simple project:
git init /tmp/a/b/c
mkdir /tmp/a/b/c/project1
touch /tmp/a/b/c/project1/file.yaml
touch /tmp/a/b/c/project1/schema.json
zeditor /tmp/a/b/c
  • add some schema into schema.json
  • create /tmp/a/b/c/.zed/settings.json:
{
  "lsp": {
    "yaml-language-server": {
      "settings": {
        "yaml": {
          "keyOrdering": false,
          "format": {
            "singleQuote": true
          },
          "schemas": {
            "./project1/schema.json": ["*.yaml"]
          }
        }
      }
    }
  }
}
  • open YAML file, add for example - example: 123 and save it
  • see error: Unable to load schema from '/tmp/a/b/c/project1,schema.json': No content. (YAML 768)
  • I also tried "project1/schema.json" and "file:./project1/schema.json" and a few other relative paths...

Thank you!

Zed Version and System Specs

Zed: v0.186.8 (Zed)
OS: Linux Wayland nixos 24.11
Memory: 93.9 GiB
Architecture: x86_64
GPU: Intel(R) Arc(tm) Graphics (MTL) || Intel open-source Mesa driver || Mesa 24.2.8

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:languages/jsonJSON data format supportarea:languages/yamlYAML data format supportstate:needs triagetriage is not complete: no `area:*` label, or no `priority:*`/`frequency:*` for Bugs/Crashes

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions