-
Notifications
You must be signed in to change notification settings - Fork 114
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
It’s not longer possible to reference schema paths using hashes #123
Comments
@aeschli This is blocking |
Schema URIs with fragments are new to me. |
@remcohaszing We never intentionally supported |
Just create a file named I only nailed it down to this issue, because I troubleshooted the issue in |
So maybe the request service of the yaml language server knows how to load the schema with fragment, parses the schema resource and returns the sub schema. If that's broken, this should be debugged and maybe fixed in the yaml language service. As said it's not a use we thought of in the json-language-service. We can think of adding that feature to the json-languageservice, I implemented it in https://github.com/microsoft/vscode-json-languageservice/tree/aeschli/schemaWithFragment. |
I’m not familiar with meta schemas, so I trust you know more about this than I do. :) From my perspective it just used to work, until it didn’t at some point. If this isn’t spec compliant, I understand you’d rather not include this feature. However, since using Also schemas aren’t only referenced through |
The schemas now use an intermediate schema to resolve the hash using a ref. For more info, see: microsoft/vscode-json-languageservice#123 redhat-developer/yaml-language-server#585 redhat-developer/yaml-language-server#637 redhat-developer/yaml-language-server#823
The schemas now use an intermediate schema to resolve the hash using a ref. For more info, see: microsoft/vscode-json-languageservice#123 redhat-developer/yaml-language-server#585 redhat-developer/yaml-language-server#637 redhat-developer/yaml-language-server#823
The use of a JSON Pointer in a URL hash to reference a sub-schema is explained here and here. The problem is unrelated to the I did find a workaround:
settings.json: {
"yaml.schemas": {
"schemas/parameter.yaml": [
"**/components/parameters/**/*.yaml"
]
}
} schemas/parameter.yaml: $ref: https://raw.githubusercontent.com/OAI/OpenAPI-Specification/main/schemas/v3.1/schema.json#/$defs/parameter My assumption is that this delegates to the JSON Schema parser which properly handles the |
Trying to figure out the cause of redhat-developer/yaml-language-server#585 I narrowed it down to a change in
vscode-json-languageservice@4.1.9
.Based on the diff between 4.1.8 and 4.1.9 I suspect 6a3406c is the commit which causes the issue.
When I use the latest version of Visual Studio Code (1.63.2) I can reproduce this issue by creating the following JSON file:
This should display a number of errors, but instead it silently fails to load the JSON schema.
The text was updated successfully, but these errors were encountered: