-
Notifications
You must be signed in to change notification settings - Fork 30.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[json] support meta-schema features #155379
Comments
Thanks for creating this issue! It looks like you may be using an old version of VS Code, the latest stable release is 1.69.1. Please try upgrading to the latest version and checking whether this issue remains. Happy Coding! |
As explained in the release notes we don't yet have support for meta-schema. |
Thanks for your clarification. You are absolutely right and somehow I missed that. Is this feature on the roadmap or far ahead? |
It's not on the plan for now as other work has higher priority. Please add your vote on the issue so give this more weight. Or, if you want to give it a try, PR are very welcome. The implementation is in https://github.com/microsoft/vscode-json-languageservice |
I know this is not on the roadmap, but Is there any known alternative? Is there any way for us to use VSCode for JSON Schema authoring, with all the benefits of autocomplete, etc? |
Curiously, I just opened a folder and configured {
"json.schemas": [
{
"fileMatch": ["*.schema.json"],
"url": "https://json-schema.org/draft/2019-09/schema"
}
]
} Unfortunately, the Summarizing. Once you properly configure your workspace, this works: {
"$id": "https://REDACTED/REDACTED/core/table-migration-config/v1",
// ...
} But this breaks, even though it's the very same Schema URL: {
"$schema": "https://json-schema.org/draft/2019-09/schema",
"$id": "https://REDACTED/REDACTED/core/table-migration-config/v1",
// ...
} Whi is the behaviour different? I imagine those default JSON-Schema URLs are ubiquitous enough to receive a special treatment, so they may be internally resolved to a dereferenced schema object/string in VSCode, somehow -- especially given that the language service has no support for meta-schemas, so it must be dealt with outside the language service itself. Considering that, would it be possible to interpret the "$schema" in the JSON file the same way the workspace settings URL is dealt with, for this specific use-case (of schema authoring, from a default JSON-Schema URL)? |
The |
@aeschli oh, fair point, maybe filter these notices when you're referencing the actual schema spec? :) |
@JustinGrote Using the spec, which uses |
@aeschli any news on this? |
It maybe fix this .vscode/settings.json {
"yaml.schemas": {
"https://json-schema.org/draft/2020-12/schema": ["my.schema.json"]
}
} |
I think that #98724 is related to this. |
Would love to see this get in. |
Would highly appreciate this beeing implemented. |
Would love support for newer schemas too... |
Are we making any progress on this? |
Hi, does anyone have more information about |
What information do you need? |
I wanted to find out if VSCode will soon support validation for |
Thanks you !! @JustinGrote |
Issue Type: Bug
So basically I have a VS Code extension that provides JSON file validation based on the built in JSON validator. The schema that I'm validating against (OpenAPI 3.1.x) uses meta-schema features, i.e.
$dynamicRef
, which I also need to use, since I reference the OpenAPI schema.When defining a custom schema like the following, I get a warning stating that the validator doesn't support meta-schema features yet. Needless to say, validation does really not work. When using normal
$ref
, most of the schema work but not properties that use$dynamicRef
. So I'm forced to reference the schema by$dynamicRef
as well.I'm using VS Code 1.69.0 and changed the required engine of my extension to ^1.68.0, which should include support for schema verion Draft 2020-12 as stated in the May 2022 release notes. What are my options here and how can I come around this warning?
Here's an excerpt of the extension package.json
VS Code version: Code 1.69.0 (92d25e3, 2022-07-07T05:28:36.503Z)
OS version: Windows_NT x64 10.0.22000
Restricted Mode: No
Remote OS version: Linux x64 5.10.102.1-microsoft-standard-WSL2
System Info
canvas_oop_rasterization: disabled_off
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_renderer: enabled_on
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
Extensions (72)
(2 theme extensions excluded)
The text was updated successfully, but these errors were encountered: